Skip to content

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
bvaughn:masterfrom
driskell:scrolltooffset
Open

feat: Add additional scrollToOffset (prop) / offset (method calls) to allow scrolling to cells but offset by some pixels#1896
driskell wants to merge 1 commit into
bvaughn:masterfrom
driskell:scrolltooffset

Conversation

@driskell
Copy link
Copy Markdown

@driskell driskell commented Jun 6, 2026

  • The existing test suites (npm test) all pass
  • For any new features or bug fixes, both positive and negative test cases have been added
  • For any new features, documentation has been added
  • For any documentation changes, the text has been proofread and is clear to both experienced users and beginners.
  • Format your code with prettier (yarn run prettier).
  • Run the Flow typechecks (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 end and 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! :)

… allow scrolling to cells but offset by some pixels
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.

1 participant