-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rootMargin not working until after the first time intersecting #495
Comments
@stramel Thank you for reporting this issue, I know the root cause, will fix it soon! |
Thanks! Just wanted to confirm that it is still an issue with v1.3.0 https://codesandbox.io/s/react-cool-inviewissues495-with-v130-zosed |
@stramel I copied your example to debug this issue with the latest version in my project (created by CRA) but I can not reproduce it, I'm not sure whether it only exists in the environment of the codesandbox (due to the issue of iframe) or not. Can it be reproduced in your project side? |
@wellyshen It does appear that it works properly in a CRA environment. So this probably isn't a bug with the library but maybe one with the browser's Intersection Observer implementation. I did notice, that it looks like the state isn't reset properly? The |
@stramel That make sense, I will fix the scrollDirection part soon. |
Going to close this issue in favor of a new one to show the other issues that I have found with |
@stramel Thank you bro, your issues really helpful. |
Thanks for the cool 😎 library! 👍🏼 |
Bug Report
Describe the Bug
The
rootMargin
is being ignore until after the first time theIntersectionObserver
firesisIntersecting
.How to Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
rootMargin
and customref
isIntersecting
isfalse
until the element is visible.isIntersecting
istrue
at the expectedrootMargin
CodeSandbox Link
https://codesandbox.io/s/react-cool-inviewissues495-0g4yk
Expected Behavior
Should respect the
rootMargin
on the initial scrollScreenshots
Your Environment
The text was updated successfully, but these errors were encountered: