Skip to content

Add support for any element - #14

Open
jrosspaperless wants to merge 3 commits into
FedericoDiRosa:masterfrom
jnrcorp:master
Open

Add support for any element#14
jrosspaperless wants to merge 3 commits into
FedericoDiRosa:masterfrom
jnrcorp:master

Conversation

@jrosspaperless

@jrosspaperless jrosspaperless commented Sep 17, 2021

Copy link
Copy Markdown

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
Comment thread src/index.jsx
({ scrollLeft, scrollTop, scrollOffset, scrollUpdateWasRequested }) => {
({
scrollLeft = 0, // This is not provided by react-window
scrollTop = 0, // This is not provided by react-window

@jrosspaperless jrosspaperless Sep 17, 2021

Copy link
Copy Markdown
Author

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
Copy Markdown

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