bvaughn / react-virtualized

React components for efficiently rendering large lists and tabular data
http://bvaughn.github.io/react-virtualized/
MIT License
26.1k stars 3.05k forks source link

List scrolling with support of CSS "scroll-snap-align" property #1767

Open kigo9 opened 1 year ago

kigo9 commented 1 year ago

Hello! First of all, thanks for an awesome library!

I would like to know if it is possible to add support for CSS "scroll-snap-align" for a List component. So that you could render, let's say, 100 children elements with only 3 in a viewport and always align the second one in the middle (using scroll-snap-align: center) after scrolling stops. Like it is done here (https://codesandbox.io/s/scroll-snap-qx0di), but with a "windowing" opportunity. I found some solutions that kind of try to do the same with JS (https://codesandbox.io/s/p3zry30rl0), but they do the alignment really rough.

I need this in order to implement active value selection by swiping the list. So that the value in the middle is currently active and highlighted.

But maybe I missed something and this functionality is already available? Would really appreciate getting the answer to this. Thanks in advance