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

update scroll value on scroll #64

Closed
wants to merge 1 commit into from

Conversation

chrisdrackett
Copy link
Contributor

I feel like if you are watching a scroll value you'll want to know as and when it is changing. I took a stab at adding this functionality!

closes #62

@shaulgo
Copy link

shaulgo commented Jul 1, 2018

Hey, I needed the exact same behavior. I'm wondering if there's a reason not to use react's onScroll event in your pr?

Also, there's a fairly simple workaround for this. For anyone that needs this before it is merged.
You can call the measure function in the onScroll event.
<Measure client scroll onResize={({ scroll, client }) => this.onResize(scroll, client)}>
{({ measure, measureRef }) => (
<div ref={measureRef} onScroll={() => measure()}>....
)}

@souporserious
Copy link
Owner

Please use the method above using the measure function 🤗

@lxgreen
Copy link

lxgreen commented Jun 13, 2019

@shaulgo it is Jun 13 2019 and I'm looking for onScroll, and find you here! 🤣

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.

should this component listen to scroll events if scroll is being measured?
4 participants