* Check all observed entries, not only first * fix: formatting --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
@@ -18,7 +18,7 @@
const rootMargin = `${top}px ${right}px ${bottom}px ${left}px`;
const observer = new IntersectionObserver(
(entries) => {
- intersecting = entries[0].isIntersecting;
+ intersecting = entries.some((entry) => entry.isIntersecting);
if (!intersecting) {
dispatch('hidden', container);
}