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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No handler for determining visibility of elements that never change visibility #174

Open
bmaximilian opened this issue Feb 18, 2020 · 0 comments

Comments

@bmaximilian
Copy link

Problem

Assume having a list of elements that should be checked in the interval but are in the middle of a scroll container so the visibility will never change. That won't trigger the onChange handler.
But the use case of the application won't allow to expect that the element is visible from beginning (so we could check at render) and a callback needs to be called when it is visible for a certain time. The callback could not be called in the render method because it affects the performance and should be called when the check is done.
Such a handler is not implemented.

Suggestion

Introduce a onCheck prop where a callback can be registered that is called after a check is done (with the isVisible, even if it didn't change).

bmaximilian added a commit to bmaximilian/react-visibility-sensor that referenced this issue Feb 18, 2020
…at is executed whenever the element is checked
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

No branches or pull requests

1 participant