Skip to content

Conversation

exogen
Copy link
Owner

@exogen exogen commented May 8, 2020

Using the previous strategy, in rare circumstances Firefox's IntersectionObserver implementation seems to think there is still overflow even when a container is scrolled all the way to one end.

It would report an IntersectionObserver entry with an intersectionRatio of 0 and isIntersecting of true, which doesn't really make any sense.

I suspect it's due to non-integer element sizes (like if you have an element whose width is purely based on its text content, it could get a width like 120.45).

Either adding another threshold entry of 0 and also checking intersectionRatio both seem to fix it. I'm doing both to play it safe.

@exogen exogen merged commit 8372d89 into master May 8, 2020
@exogen exogen deleted the bugfix/firefox-intersection-ratio branch May 8, 2020 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant