(This question pertains to the react-virtualized library)
I have a component that uses <List>
to display several categories of items. The resulting output looks something like:
Jump to: Planets, Nebulae
PLANETS
- Mercury
- Venus
- Jupiter
- ...
NEBULAE
- Horsehead
- Ant
- Boomerang
- ...
I'd like to use the "Jump to" links to scroll to the start of the corresponding section in the list. If I scroll around some I'd like subsequent clicks of the jump link to take me back to the section.
The first time I click the "Nebulae" link it works fine, but nothing happens on subsequent clicks. I assume this is because scrollToIndex
is a prop and doesn't change after the first click. I've tried using forceUpdateGrid
but it doesn't seem to reset the scroll position.
Is there a way to jump to the same index multiple times in a row?