fix cached scroll top position ignored when value is 0 (on top)
This commit is contained in:
parent
e96de76289
commit
ea609d8ea9
1 changed files with 1 additions and 1 deletions
|
|
@ -142,7 +142,7 @@ export const useTimelineScrollRestore = (
|
|||
if (scrollEl) {
|
||||
const scrollTop = timeline.range.scrollTopCache;
|
||||
const batch = timeline.batch.read;
|
||||
if (scrollTop) {
|
||||
if (typeof scrollTop === 'number') {
|
||||
scrollEl.scrollTo({ top: scrollTop, behavior: 'instant' });
|
||||
} else if (batch.next.end && batch.messages.events.length > 0) {
|
||||
scrollToBottom(scrollEl, 'instant');
|
||||
|
|
|
|||
Loading…
Reference in a new issue