
How to retain scroll position conditionally?
What is the issue?
- View page on desktop view where it shows list and detail side by side
- Click on show more and go to page 2 or 3 or any number for that matter
- Now click on an item
CodeSandbox Link
Here is a codesandbox illustrating the issue
Question
- When filter or search changes, scroll position should be reset
- When clicking on items, scroll position should be retained
- How to retain scroll position conditionally using your library?