-
Notifications
You must be signed in to change notification settings - Fork 13.5k
bug: A cached page's virtual-scroll doesn't re-render on window resize (Keyboard or Orientation) #19264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@manucorporat I think its related to the code merged for #18878, the same bug existed in Ionic 3.8.x and was fixed in Ionic 3.9.0 #13143. This issue is preventing me from going to production, its very urgent, can you or anyone of the team update us with the status ? |
Guys, its been over two weeks since I have created the issue and have supplied all of the reproducing steps, and even provided a hint on the culprit, nobody seems to be checking any virtual scroll related issues or even commenting with acknowledgements or workarounds. Its very frustrating not being able to fix a major issue that our production app is facing because of the usage of the virtual scroll that nobody at Ionic seems to give any attention to, while I believe that its one of the most important components in Ionic, as its needed to minimize performance gaps of hybrid apps! |
This is just unbelievable that nobody from Ionic just look at this bug. It is still here in 4.11.2. |
@liamdebeasi Hey, can we please get an update on this issue, Its affecting our production app UX greatly, seems like anything related to virtual-scroll is ignored even though its a critical component for many apps. |
@omardoma I also suffer because of that, but until it is fixed you may try following code:
The downside of this solution is that scroll position can be different than it was before you left the view, but at least it renders correctly. |
3 Month past, and still no comment from ionic devs... |
This is a show stopped for our team as well. No workarounds for now |
Hey everyone! Just an update here. We're going to be pushing folks to use Angular's CDK Scroller for virtual scrolling instead of our virtual scroller. A big reason why is that CDK Scroller is a framework maintained solution, therefore support/performance are guaranteed. At this time, we're not going to be pushing fixes for our virtual scroller. For reference, I put together this repo which uses the Angular CDK scroller and Ionic, and everything was working as expected. Even browser resizing/items not collapsing. https://github.com/mhartington/cdk-virtual-scroll-ionic I highly suggest people start using the CDK scroller in their apps now, as we'll eventually remove virtual scroll from the framework specific bindings. |
Hey @mhartington, thanks for the update and for providing the example, however I am afraid that using the CDK scroller causes problems when used with ion-infinite-scroll and ion-refresher, please check this thread to know more about the issues, is there a workaround or a specific way to use them together at the moment? |
Hey @mhartington I know you've done some fiddling in the past with CDK's VS but never got around to bringing this into Ionic. At that time I had also tried moving from Ionic to CDK as I imagined something like this might happen, but faced multiple issues on migrating. |
Hey guys, I had the same problem and went down a few paths before coming up with a solution that, so far, works for me... hopefully this works for others as well. FYI I've only tried this using Angular 8.1.2, interfacing with ionic serve as devapp on iPad Mini 4 (ionic serve --devapp). My approach:
The code:
There's probably a better event to use to induce the resizing sooner than the NavigationEnd event, which may provide a better UX. Let me know your thoughts on this. Edit: |
@omardoma Hi. I exactly have the same problem in a same scenario. I navigate to chat page, open keyboard and navigate back and cards are overlapped. I tried andular CDK and had same problem. It didn't overlap, but didn't show the cards correctly and juts renders 2 or 3 of them. Did you find any solution for that? It's about a week I'm looking for a solution. |
a lazy workaround would be |
i am using window.dispatchEvent(new Event ('resize')); .. virtual item was rerendered.. but list item was coming for duplicate items and my scroll position was change.. plz solve this issue.. |
the window resize hack kind of works
Except that sometimes (always?) when you go back to the screen with virtual scroll, it doesn't put you back at the position you were at. EDIT: i think the mis-positioning in scroll can be mitigated by making sure that your virtual scroll items are all the same height, and match the approxItemHeight passed in to virtual scroll. I think it's just too dumb to add up the heights of items, and just uses this approx height to get back to position it thinks it was in |
I am facing the same issue... when i switch to another tab that has an input, and the keyboard opens up, then i switch back to the tab that has ion-virtual-scroll, it does exactly this. |
Hey Ionic / @mhartington. Thanks for your advisory to use the CDK virtual scroller. Is this still Ionic's held position? It's not clear in the docs whether ion-virtual-scroll is deprecated or not. If so, would you mind adding a note (or accepting a pr) in the docs that communicates this? |
Facing the same issue. Would be nice if Ionic had a look. |
Any update on this bug guys? We have a ionic 5 app and there is the same problem. |
Hey everyone. Not sure if this really helps with this specific issue but the Ionic guys have recently clarified their position on the future of the virtual scroller
|
Angular virtual scroller yet not compatible with ion-refresher and ion-infinite-scroller so I continued using ion-virtual-scroller so I added some fixes to make it smooth and it is working perfect ( data getting persisted on back)
|
Thanks for the issue! With the release of Ionic 6 we will be deprecating Using these new virtual scrolling solutions should provide a better developer experience, more performant app, and fewer bugs! We have created migration guides for the main 3 JavaScript Frameworks Ionic supports to make this migration easy for developers. Migration for Angular users: https://ionicframework.com/docs/angular/virtual-scroll The documentation for
I am going to close this issue. Thank you! We are tracking issues with components like |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Bug Report
If you have a route that contains an ion-virtual-scroll, then you navigate forward (So the previous route is cached and reused), if the new current page triggers a resize, then you go back to the cached route, the virtual scroll items will collapse and overlap each others.
Ionic version:
[x] 4.8.1
Current behavior:
An ion-virtual-scroll existing on a cached route doesn't react to screen resizes and it collapses when navigating back to its page.
Expected behavior:
ion-virtual-scroll should react to screen resizes even if its page is not the active one.
Steps to reproduce:
Tabs are affected heavily because all of their views are cached and reused
It happens on all platforms and on both, virtual devices and real devices.
Other information:
#18409
Ionic info:
The text was updated successfully, but these errors were encountered: