Add support for any element - #14
Open
jrosspaperless wants to merge 3 commits into
Open
Conversation
jrosspaperless
force-pushed
the
master
branch
4 times, most recently
from
September 17, 2021 17:57
8b0737b to
3721fc7
Compare
jrosspaperless
force-pushed
the
master
branch
from
September 17, 2021 18:01
bd87c8d to
423d192
Compare
jrosspaperless
commented
Sep 17, 2021
| ({ scrollLeft, scrollTop, scrollOffset, scrollUpdateWasRequested }) => { | ||
| ({ | ||
| scrollLeft = 0, // This is not provided by react-window | ||
| scrollTop = 0, // This is not provided by react-window |
Author
There was a problem hiding this comment.
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
|
This PR should be merged @FedericoDiRosa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.