bvaughn / react-window

React components for efficiently rendering large lists and tabular data
https://react-window.now.sh/
MIT License
15.48k stars 778 forks source link

Remove nodes in pairs to avoid zebra stripe flashing #744

Open jasonbarry opened 8 months ago

jasonbarry commented 8 months ago

If a table has zebra-style rows declared by :odd or :even CSS selectors, scrolling will remove nodes from the top of the DOM tree one-by-one, making the previously odd rows even and vice versa.

It would be nice if we could specify to remove nodes in pairs, so odd-numbered rows would stay odd, and even-numbered rows would stay even, as the user scrolled.

Otherwise, a zebra stripe flashing occurs on scroll.

szszoke commented 3 months ago

A workaround is to apply the even/odd styling based on the index.