bvaughn / react-window

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

`scrollToItem` does not work correctly with sticky items #586

Closed jonsmithers closed 2 months ago

jonsmithers commented 3 years ago

When I follow the readme's example on sticky items, the scrollToItem fails to scroll items into view when scrolling up. The method does not account for the shrunken viewport caused by the sticky items.

https://codesandbox.io/s/great-ganguly-1821j

In the above sandbox, the scroll to row 2 button should cause Row 2 to be scrolled into view, but the table only scrolls up enough for Row 4 to be visible.

Maybe this is intended behavior and the only fix is for us to implement our own scrollToItem which accounts for the sticky items' offset.

codebycarlos commented 2 years ago

Having the same issue

Dodie324 commented 2 years ago

Not surprised. Sticky rows doesn't even seem to work in general. Has anyone figured out a better, working solution for sticky rows?