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

Masonry scroll handler relies on event.target instead of event.currentTarget #1414

Open
chinmaychaudhary opened this issue Aug 28, 2019 · 0 comments

Comments

@chinmaychaudhary
Copy link
Contributor

chinmaychaudhary commented Aug 28, 2019

Example: https://codesandbox.io/s/masonry-scroll-bug-e5vsd

On scrolling the red bordered div, everything is fine. When scrolling any of the inner divs i.e. the colored blocks, the onScroll for Masonry is invoked. The scroll handler of Masonry then looks at event.target (

const eventScrollTop = event.target.scrollTop;
) instead of event.currentTarget which leads to incorrect behavior.

What is the current behavior?

If there's any scroll which is propagated to Masonry's div, the scrollTop is calculated using event.target instead of event.currentTarget (

const eventScrollTop = event.target.scrollTop;
)

What is the expected behavior?

The scroll handler should look at the scrollTop of event.currentTarget

Which versions of React and react-virtualized, and which browser / OS are affected by this issue? Did this work in previous versions of react-virtualized?

Browser : Chrome
OS : MacOS
React : 16.9.0
React DOM : 16.9.0
react-virtualized : 9.21.1

@chinmaychaudhary chinmaychaudhary changed the title Masonry scroll handler looks at event.target instead of event.currentTarget Masonry scroll handler relies on event.target instead of event.currentTarget Aug 28, 2019
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