petyosi / react-virtuoso

The most powerful virtual list component for React
https://virtuoso.dev
MIT License
5.13k stars 299 forks source link

[BUG] Table scrolls to top when search params change #1057

Closed futurliberta closed 5 months ago

futurliberta commented 5 months ago

Hi

Description of the bug With react-router-dom, when navigate or setSearchParams is used to update search params, the virtuoso table scrolls back to top.

Reproduction CodeSandbox

Expected behavior Keep the scroll position.

Additional context OS: Windows 10 Browsers: Chrome 123, Edge 122

petyosi commented 5 months ago

This is not a bug, you're misusing the component. Read the docs.