w3c/IntersectionObserver

Callback isn't fired when .observe(element) is ran on an element that has not yet been added to the dom

danieltroger opened this issue · 1 comments

Just noticed this in IE11. Sorry for bad issue report already spent too much time debugging.

But maybe this is enough to reproduce?
Create an observer and an element, run observer.observe(element). Then chill for some time and later run document.body.append(element). The observer will trigger once, before the element is added, with all intersectionRations being 0 and after having been added it will never trigger again with correct intersection ratios. Also tried setting polling to 100ms, didn't work. Only thing that worked was waiting with .observe before adding element to DOM.

It seems like support for IE11 is ending... next week. 😅

If the bug reproduces in another browser, I would recommend you file a bug against their bug tracker. Thanks!