Currently my observer is only logging the entry/ exit point as the top of the element inside the viewport. How do I watch for the entry/exit of the whole element / elements bottom
this.observer = new IntersectionObserver(
(entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
console.log("Enter");
return;
}
console.log("Leave");
});
},
{
rootMargin: "0px 0px 0px",
root: null,
threshold: 0,
}
);