Skip to content
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

scroll position is still jerky when backfilling #528

Closed
matrixbot opened this issue Dec 16, 2015 · 3 comments
Closed

scroll position is still jerky when backfilling #528

matrixbot opened this issue Dec 16, 2015 · 3 comments

Comments

@matrixbot
Copy link

Created by @ richvdh:matrix.org.

@richvdh
Copy link
Member

richvdh commented Dec 16, 2015

Matthew is still observing jerky scroll position when we are backfilling: specifically, when doing a two-finger scroll backwards in time, the scroll position sometimes jumps to the top of the room rather than preserving position.

@richvdh
Copy link
Member

richvdh commented Dec 16, 2015

The problem is that we see a scroll event arriving after we reset the scroll position, but with the scroll offset reset to old values:

2015-12-16 15:08:24.147 RoomView.js:325 paginate complete
2015-12-16 15:08:24.211 RoomView.js:926 Scrolled to event $145027813095505zwpiN:matrix.org + 21 : 1832
2015-12-16 15:08:24.237 RoomView.js:926 Scrolled to event $145027813095505zwpiN:matrix.org + 21 : 1832
2015-12-16 15:08:24.242 RoomView.js:395 Scroll event: offset now 528
2015-12-16 15:08:24.243 RoomView.js:399 Saved scroll state Object {atBottom: false, lastDisplayedEvent: "$145027622893037urerU:matrix.org", pixelOffset: 81}
  • why is the scroll offset suddenly reset from 1832 to 528?

We could hack around this by ignoring the scroll events until we get one which (roughly?) matches the scroll offset we assigned... but that feels ugly and fragile. I'd like to understand what is causing the reset.

richvdh added a commit to matrix-org/matrix-react-sdk that referenced this issue Dec 16, 2015
Keep resetting our scroll offset until the DOM believes us. Hopefully this will
fix element-hq/element-web#528.
@richvdh
Copy link
Member

richvdh commented Dec 16, 2015

Hopefully this has been fixed by matrix-org/matrix-react-sdk#56

@richvdh richvdh closed this as completed Dec 16, 2015
richvdh added a commit to matrix-org/matrix-react-sdk that referenced this issue Apr 5, 2016
Under certain conditions, it was possible to get stuck in a state where any
user-initiated scroll would be met with "Working around
element-hq/element-web#528" and overridden. Fix this by removing the duplication
between _lastSetScroll and recentEventScroll, and using _lastSetScroll which is
more reliable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants