feat: Add additional scrollToOffset (prop) / offset (method calls) to allow scrolling to cells but offset by some pixels#1896
Open
driskell wants to merge 1 commit into
Open
Conversation
… allow scrolling to cells but offset by some pixels
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.
npm test) all passyarn run prettier).yarn run typecheck).NOTE: AI was used to help build the tests and also to check some of the initial basic work I did for this and fill in some gaps.
This might be something to discuss and it was quick to mock up. It's a feature I found us needing.
Essentially we have WindowScroller, AutoSizer and List. We have a sticky navigation at the top of the page. Using scrollToRow / scrollToCell was problematic as it was hiding the cell underneath the sticky navigation. We needed a way to essentially tell the virtualiser that we need cell X to start 30 pixels down the page. In other words offset by
-30.I chose not to mess with alignment (could it be a number for example that becomes offset) as it seems more flexible with a new property. You can use the offset in coordination with any value. For example if you had a footer that floated above content you could still use
endand an offset to prevent it appearing underneath it.Open to discussion here and if there's other approaches but this seemed relatively straight forward and a good enhancement - but of course I would when I benefit from it! :)