Replies: 3 comments 3 replies
-
@harun911 Hi this is weird behavior on demo code it's always false when it's not visible. For example this could be fault of CSS recalculation or wrong options like threshold. But overall its hard to guess it without seeing a code. You can always use IntersectionObserverEntry directly from |
Beta Was this translation helpful? Give feedback.
-
Hello, I have the exact same issue as @harun911! Did you find a solution? There are 20 items in a list. Only 6 are visible. The first 20 logs all have The weird thing is it only happens on the first load of modal. If I close and open the modal again it works as expected. |
Beta Was this translation helpful? Give feedback.
-
I'm closing it, issue was with lack of pre-defined size for images. |
Beta Was this translation helpful? Give feedback.
-
Hello k3nsei,
first of all, thank you for this beautiful library to make it easy to use of the intersection observer api.
I want to use this library to render angular animations when an element becomes visible in the viewport, and run the animation only once after the user has seen it. However I'm experiencing an issue which I hope you can clarify or help me with.
The issue arises on initial load of the page, the onIntersection method gets called after page load.
When I console.log the onIntersection method, I can see the target logged with the value of the visible property.
This is first true and then reverts to false. When I have 5 elements which have the inViewPort tag, I can see 5 calls being made on initial load, even when they are not visible within the viewport at that moment. How can I prevent this initial call from happening for the elemens that are not visible? Or is there another way you would advise to setup the component?
I have followed the installation tutorial as available on the github page.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions