Add `scrollToIndex` to `WindowVirtualizer`
Is your feature request related to a problem? Please describe.
I am using WindowVirtualizer to virtualize table rows, as I don't want to define fixed height for the table. I'd like to use scrollToIndex to implement find and replace functionality in my app. However, WindowVirtualizer does not have this feature.
Describe the solution you'd like
Add scrollToIndex to WindowVirtualizer if possible 🙏
Describe alternatives you've considered
- migrating to VList, but I was unable to get the table to have 100% height, like with
WindowVirtualizer. I want the body of the page to be scrollable, not the table itself, as there are more elements after the table.
Additional context
- using React
I tried to get this working by myself but with no luck. The scrolling worked fine with 1 WindowVirtualizer, but with multiple, there were inconsistencies in scrolling behavior. (I have multiple virtualized tables on the same page)
Any chance you can take a look at this @inokawa? Perhaps I can sponsor the development if that would help 🙂
2 or more WindowScrollers in one view will not work as expected in some situations. We have to find some workaround. https://github.com/inokawa/virtua/blob/ccd002e2c879b6f9f124d6b4b3c7b9ade252194f/src/core/scroller.ts#L413
Released in 0.37.4. The 2 scrollers issue will be addressed in #555 .