[BUG] children components of VirtuosoGrid get unmounted when navigate on Ionic5
See original GitHub issueDescribe the bug
Children elements of VirtuosoGrid get unmounted when navigate to other page using Ionic router. This only happens when custom scroll element is passed to customScrollParent props. As children components are unmounted, scroll moves to top which causes problems.
Reproduction https://codesandbox.io/s/pedantic-dirac-5lhh7k?file=/src/pages/ListPage/ListPage.tsx
To Reproduce
There are 4 cases. Virtuoso with/without custom scroll element and VirtuosoGrid with/without custom scroll element.
Steps to reproduce the behavior:
- Go to
ListPage.tsx - Check each case. Each case is comment out.
- Scroll down several times and route to DetailPage by clicking a link. Then, go back to ListPage by clicking header back button.
Expected behavior
Items should not be unmounted after coming back to list page. Virtuoso and VirtuosoGrid without custom scroll element works as expected. Only when custom scroll element is passed to VirtuosoGrid customScrollParent props, Items are unmounted and scroll position is set to top.
Desktop (please complete the following information):
- OS: macOs 12.3(m1)
- Browser chrome 101.0.4951.64 (arm64), safari(15.4)
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)

Top Related StackOverflow Question
Got it. There’s a guard condition for that in the list but not in the grid, should be an easy fix.
🎉 This issue has been resolved in version 2.13.3 🎉
The release is available on:
Your semantic-release bot 📦🚀