I have an ion-list with an *ngFor. Previously, if I would scroll down the list and then reload the scope array bound to the *ngFor, it would populate with the new data, but the scroll position would not change.
Since upgrading to ionic 6 when the array is reloaded, the ion-list auto-scrolls to the top.
I think then you are reassigning an array which causes angular to think there is sonething really new. That causes an expensive rerender and possibly a scrolltotop
Consider keeping the old array and replacing the difference within that array?
Then the change detection may not struggle that much
I have the same issue. My app got a ion-list and a ion-modal popup for editing when click on a list item. and i found that i issue is not caused by update to the list, but caused by the event of entering edit mode when the keyboard panel shows up.
this issue only occurs on mobile, when you test it in a browser on a computer, you cant reproduce it.
i set the height of the modal to 50% so that i can see how the list go back to top in the background. and found that, when i click on the editor which is a textarea to enter edit mode, the list go back to top immediately, please notice i dont even type anything or make any change to the content in the editor. and if i dont click on the editor to enter edit mode but just click return to dismiss the modal, the list stay the same position.
the post was from 2 years ago, hope the team have already cooked up a solution.
dont know how it solved the problem, but it just did. probably when the keyboard panel shows up, the ion-content section is pushed and overflowed so it rerenders completely so it seems like jump back to the top. now that we set it hidden when overflow, it doesn’t need to rerender anymore and so it stay at where it is.