mirror of
https://github.com/danog/telegram-tt.git
synced 2024-11-27 04:45:08 +01:00
Message List: Fix losing scroll position in unread chats (follow-up)
This commit is contained in:
parent
bb75af6dcd
commit
95cfce6927
@ -471,8 +471,11 @@ const MessageList: FC<OwnProps & StateProps & DispatchProps> = ({
|
||||
} else if (anchor) {
|
||||
const newAnchorTop = anchor.getBoundingClientRect().top;
|
||||
newScrollTop = scrollTop + (newAnchorTop - (anchorTopRef.current || 0));
|
||||
} else if (unreadDivider && !scrollOffset) {
|
||||
newScrollTop = unreadDivider.offsetTop - (hasTools ? UNREAD_DIVIDER_TOP_WITH_TOOLS : UNREAD_DIVIDER_TOP);
|
||||
} else if (unreadDivider) {
|
||||
newScrollTop = Math.min(
|
||||
unreadDivider.offsetTop - (hasTools ? UNREAD_DIVIDER_TOP_WITH_TOOLS : UNREAD_DIVIDER_TOP),
|
||||
scrollHeight - scrollOffset,
|
||||
);
|
||||
} else {
|
||||
newScrollTop = scrollHeight - scrollOffset;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user