-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
New events may cause the timeline to jump up 30-40px after scrolling down #1162
Comments
I think this may be related to very tall EventTiles (be they containing images or lots of multi-line stuff) in history. |
i finally caught this with debug on (but inspector shut). it coincides with the rate-limited logging section. |
So an interesting thing in that barf is that it shows the scroll state is tracking a particular event ( That implies that when we last saw a scroll event (17:12:50.011 in the barf), the messagepanel is scrolled up more than 3 pixels from the bottom. I can't really explain why that would have been the case, though |
hmmmmmm... this is ringing a bell; could this be similar to the bug
where breakpointing things at the point of fail showed that the whole
DOM had decided to shrink its height by 50px or so? I can't remember
which bug that was or why it was happening though...
|
agreed on all fronts... |
Just got a classic instance of this, complete with uncensored logging. I think I even have the right timespan (marked in the log) where it kicked off. The scrollback suddenly jumped up whilst Erik was typing to me in Internal, and jumped as I pressed the first keystroke in starting a new message. (I wonder if this might be related to the dodgy multi-line-resizing hack that started breaking the other day? https://github.com/matrix-org/matrix-react-sdk/blob/57ffc2d2e26f5f060277c2272b220d85cf096348/src/components/views/rooms/MessageComposer.js#L260) Barf attached. I think I'll turn off the multi-line resizing on my local develop to see if that helps. |
...and again, just after you posted the ALOT img in Internal. I hadn't turned of multiline resizing yet. |
The odd thing in those barfs is all the scroll events (ones that result in 'saved scroll state ...' rather than 'ignoring scroll echo'). Unless you are manually scrolling, we wouldn't expect to see any scroll events other than scroll echoes, and their presences reinforces the idea of the DOM reshuffling itself in a way that confuses us. Looking at my console around the same time, I also see these spurious events, though in my case it ended up sorting itself out, rather than causing a jump. |
for the record:
|
With much gratidute to @kegsay, repro steps are:
I'm assuming the images were a total red herring, and merely appeared related because you're more likely to scroll up to see what went before if there is an image. The problem is that we are ignoring the final downward scroll event, because we think it is an echo of our last autoscroll. |
(you have to scroll down quite quickly, otherwise the penultimate scroll event is close enough to the bottom for us to switch to stuck-to-bottom mode) |
When the user scrolls up, and scrolls back to where they were, we want to save the final scroll state. We were ignoring it because it looked the same as the last autoscroll. Fixes element-hq/element-web#1162
Hopefully fixed by matrix-org/matrix-react-sdk#237 |
... now that element-hq/element-web#1162 is hopefully fixed
The most recent problem was that we were setting _lastSetScroll whenever we wrote to scrollTop (and ignoring the next scroll event which matched that offset), but if there was no change to scrollTop, we wouldn't actually get a scroll event, so would ignore some future scroll event instead. Make sure that we only set _lastSetScroll if there's a change to scrollTop. (Fixes element-hq/element-web#1162, more)
The jump happens either immediately after you send the message, or in the middle of sending it.
Am trying to repro with scroll debugging enabled.
The text was updated successfully, but these errors were encountered: