Skip to content

feat: Add additional scrollToOffset (prop) / offset (method calls) to allow scrolling to cells but offset by some pixels - #1896

Closed
driskell wants to merge 1 commit into
bvaughn:masterfrom
driskell:scrolltooffset
Closed

driskell wants to merge 1 commit into
bvaughn:masterfrom
driskell:scrolltooffset

Conversation

@driskell

@driskell driskell commented Jun 6, 2026

Copy link
Copy Markdown
  • 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
@github-actions github-actions Bot added the Stale label Jul 4, 2026
@github-actions github-actions Bot closed this Jul 4, 2026
@driskell

driskell commented Jul 4, 2026

Copy link
Copy Markdown
Author

How do I reopen?

@driskell

driskell commented Jul 4, 2026

Copy link
Copy Markdown
Author

@bvaughn Hiya how do I reopen? Issue is still relevant and was hoping to hear back but there’s a stale bot that seems to close indiscriminately after 28 days 😬 Thanks

@bvaughn

bvaughn commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Sorry for the very long delay in getting back to you about this!

I've just finished a large update for version 10 of react-virtualized (#1900): the library has been rewritten in TypeScript, every component is now a function component (React 18+ is required), and the source moved from source/ to lib/. Because of that, this PR can't be merged as-is. Version 10 has no pixel offset for scrollToRow/scrollToCell (the scroll props were replaced by ref methods, so this would be an offset parameter on those methods).

If you're still interested in this change, I'd welcome a new PR with it rebased onto the version-10 branch (or onto master once version 10 has been merged).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants