Intersection Observer, sometimes does not work
Reported by
llbell...@gmail.com,
Dec 27 2016
|
||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36 Steps to reproduce the problem: 1. I have many elements to be observable and each element receive callback when is visible or not 2. I scrolled the page until top and then until end, many times 3. Sometimes some elements that is visible receive the callback with intersectionRatio = 0 In this example where there is no elements in the page, just the container of the elements observeables, it happens the problem: https://jsfiddle.net/rnLsu3gt/ But in the example where we have the element <h1> the problem does not happen: https://jsfiddle.net/jvq8d2LL/ weird.. What is the expected behavior? the callback's trigger (intersectionRatio) should always be > 0 when the element is visible What went wrong? Sometimes some elements that is visible receives the callback with intersectionRatio = 0 Did this work before? N/A Does this work in other browsers? Yes Chrome version: 55.0.2883.87 Channel: stable OS Version: 6.1 (Windows 7, Windows Server 2008 R2) Flash Version: Shockwave Flash 24.0 r0
,
Jan 3 2017
I did the test in Chrome Version 55.0.2883.87, and also in Firefox Nightly Version 55.0.2883.87. The problem occurred in both. The error is more evident outside of the jsfiddle.
,
Jan 3 2017
Sorry, Firefox Nightly Version 53.0a1.
,
Jan 3 2017
IntersectionObserver will send a notification when the target is edge-adjacent to the root; look at step 2.2.7 here: http://wicg.github.io/IntersectionObserver/#update-intersection-observations-algo Others have pointed out that when you get a notification with intersectionRatio=0, it's not immediately apparent whether the transition was from not-intersecting to intersecting, or vice versa. There's a proposal to add an 'isIntersecting' flag to the notification to clarify this: https://github.com/WICG/IntersectionObserver/issues/69 Feel free to chime in on that issue if you have input on the proposal. Marking WontFix, as this is a spec issue. |
||
►
Sign in to add a comment |
||
Comment 1 by rbyers@chromium.org
, Jan 3 2017Components: -Blink>JavaScript Blink>Layout