Problem description:
Using downshift with list virtualizing libraries breaks auto scrolling with circular navigation.
Having downshift attempt to auto find the relevant dom node from highlightedIndex is helpful, but obviously with virtualization there will be no matching element.
React Virtuoso, for example, provides its own scrollIntoView API based on index, and while downshift supports passing a custom scrollIntoView function as a prop, which could facilitate this connection, it's not possible to access highlightedIndex from this callback.
Suggested solution:
Passing highlightedIndex as a third argument to scollIntoView (potentially via an options object), would allow the consumer to implement the custom logic necessary.
Problem description:
Using
downshiftwith list virtualizing libraries breaks auto scrolling with circular navigation.Having downshift attempt to auto find the relevant dom node from
highlightedIndexis helpful, but obviously with virtualization there will be no matching element.React Virtuoso, for example, provides its own
scrollIntoViewAPI based onindex, and while downshift supports passing a customscrollIntoViewfunction as a prop, which could facilitate this connection, it's not possible to accesshighlightedIndexfrom this callback.Suggested solution:
Passing
highlightedIndexas a third argument toscollIntoView(potentially via an options object), would allow the consumer to implement the custom logic necessary.