[BUG] Scroll reset on layout animation
2. Describe the bug
I try to do a layout animation when I reorder a grid of elements. But for some unknown reasons when I reorder the list sometimes the scroll reset to the top of the page.
3. IMPORTANT: Provide a CodeSandbox reproduction of the bug
https://codepen.io/JAWStm/pen/ExrjQZj?editors=0011
When you click an element it will make it go the the begining of the list. And the bug will appear.
4. Steps to reproduce
Steps to reproduce the behavior:
- Create a grid with some items
- Reorder the list using logic or random sort
- The scroll will be reset
5. Expected behavior
The scroll should stay at the same position every time.
6. Video or screenshots
No Video
7. Environment details
OS: Windows 10 Browser: Chrome
Thanks for your help, but this don't fix the scroll. Do you have any other ideas ?
I'm experiencing the exact same issue. I have a grid of items that I reorder randomly with setInterval. Sometimes the scroll position is changed, sometimes it isn't.
I've tried setting an explicit height on the parent div, but that doesn't seem to help. Any ideas?