Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Viewport listeners not provided IntersectionObserverEntry #1364

Closed
kalley opened this issue Nov 22, 2021 · 0 comments 路 Fixed by #1365
Closed

[BUG] Viewport listeners not provided IntersectionObserverEntry #1364

kalley opened this issue Nov 22, 2021 · 0 comments 路 Fixed by #1365
Labels

Comments

@kalley
Copy link

@kalley kalley commented Nov 22, 2021

1. Read the FAQs 馃憞

2. Describe the bug

The docs state that the IntersectionObserverEntry is provided to both onViewportEnter and onViewportLeave, but that is not actually the case as can be seen here:

const callback = isIntersecting
? props.onViewportEnter
: props.onViewportLeave
callback?.()

3. IMPORTANT: Provide a CodeSandbox reproduction of the bug

A CodeSandbox minimal reproduction will allow us to quickly follow the reproduction steps. Without one, this bug report won't be accepted.

https://codesandbox.io/s/blissful-dirac-lyu9b?file=/src/App.js

You can see that undefined is logged to the console

4. Steps to reproduce

Steps to reproduce the behavior:

  1. Go to the codesandbox
  2. Open the console
  3. See { entry: undefined }.

5. Expected behavior

That entry should be an instance of IntersectionObserverEntry as stated in the docs

@kalley kalley added the bug label Nov 22, 2021
@mattgperry mattgperry changed the title [BUG] [BUG] Viewport listeners not provided IntersectionObserverEntry Nov 23, 2021
@mergetron mergetron bot closed this in #1365 Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant