Skip to content

Add support for any element #14

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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