Bug: scroll position sometimes preserved across pages
randomouscrap98 opened this issue · 3 comments
The scroll position of the message list is sometimes stuck at the top if the previous page was at the top, or maybe it has something to do with the size of the messagelist between room loads. In any case, it's an inconsistent experience, because sometimes it DOES scroll to the bottom when you click through rooms
There's a page of documentation on scrolling for Vue Router https://router.vuejs.org/guide/advanced/scroll-behavior.html, but will probably need to somehow attach an ID to the scroller.
What will probably happen is that I will probably modify Scroller.vue so that it can take in an id (in this case, probably #chat-view
or something) and then somehow saves it? There might need to be a small delay but I don't remember if Vue actually caches the Markup messages or not when swapping between pages.
Oh I'm not asking for it to BE preserved, I'm saying it should just be reset every time you switch to the room. Although I suppose preserving the scroll is nice but... I think most people expect the behavior that when the room is loaded, you're at the freshest messages
it should be noted that this IS implemented now, but I'm not 100% on the behaviour of it always scrolling to the bottom regardless if activity happened or not. really, the bigger issue was the animation between swapping between pages that was disorientating, imo, and of course the scroll position was being kept between pages for no reason.
I'm thinking of the behaviour where it does save the position if there are no new messages (or no changed watch value), but it will need to be in a store of some sort because the ScrollerView is always going to be destroyed before I can store the values if you go to another page type other than /page/