Fix: Remove jittery timeline scrolling after jumping to an event (#8263)
* Fix: Remove jittery timeline scrolling after jumping to an event * Fix: Remove onUserScroll handler and merge it with onScroll * Fix: Reset scrollIntoView state earlier Co-authored-by: Janne Mareike Koschinski <jannemk@element.io>
This commit is contained in:
parent
285dc25b3e
commit
579a166113
11 changed files with 118 additions and 87 deletions
|
@ -62,6 +62,8 @@ const INITIAL_STATE = {
|
|||
initialEventPixelOffset: null,
|
||||
// Whether to highlight the initial event
|
||||
isInitialEventHighlighted: false,
|
||||
// whether to scroll `event_id` into view
|
||||
initialEventScrollIntoView: true,
|
||||
|
||||
// The room alias of the room (or null if not originally specified in view_room)
|
||||
roomAlias: null,
|
||||
|
@ -291,6 +293,7 @@ export class RoomViewStore extends Store<ActionPayload> {
|
|||
roomAlias: payload.room_alias,
|
||||
initialEventId: payload.event_id,
|
||||
isInitialEventHighlighted: payload.highlighted,
|
||||
initialEventScrollIntoView: payload.scroll_into_view ?? true,
|
||||
roomLoading: false,
|
||||
roomLoadError: null,
|
||||
// should peek by default
|
||||
|
@ -333,6 +336,7 @@ export class RoomViewStore extends Store<ActionPayload> {
|
|||
initialEventId: null,
|
||||
initialEventPixelOffset: null,
|
||||
isInitialEventHighlighted: null,
|
||||
initialEventScrollIntoView: true,
|
||||
roomAlias: payload.room_alias,
|
||||
roomLoading: true,
|
||||
roomLoadError: null,
|
||||
|
@ -475,6 +479,11 @@ export class RoomViewStore extends Store<ActionPayload> {
|
|||
return this.state.isInitialEventHighlighted;
|
||||
}
|
||||
|
||||
// Whether to avoid jumping to the initial event
|
||||
public initialEventScrollIntoView() {
|
||||
return this.state.initialEventScrollIntoView;
|
||||
}
|
||||
|
||||
// The room alias of the room (or null if not originally specified in view_room)
|
||||
public getRoomAlias() {
|
||||
return this.state.roomAlias;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue