Skip to content

Conversation

@jrosspaperless
Copy link

@jrosspaperless jrosspaperless commented Sep 17, 2021

Resolves Issue #13

This allows the scroll to be any element provided instead of only the window. I updated the example to show how it can used.

@jrosspaperless jrosspaperless force-pushed the master branch 4 times, most recently from 8b0737b to 3721fc7 Compare September 17, 2021 17:57
({ scrollLeft, scrollTop, scrollOffset, scrollUpdateWasRequested }) => {
({
scrollLeft = 0, // This is not provided by react-window
scrollTop = 0, // This is not provided by react-window
Copy link
Author

@jrosspaperless jrosspaperless Sep 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

react-window passes scrollDirection: ScrollDirection not scrollLeft and scrollTop. Without setting 0 as default, this function does not do anything as the numbers end up as NaN. From what I can tell, defaulting to 0 resolves that issue and results in this executing properly. Not sure why they are part of the method signature, though.

https://github.com/bvaughn/react-window/blob/master/src/createListComponent.js#L393-L409

@vaasu-dhand-als
Copy link

This PR should be merged @FedericoDiRosa

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.

2 participants