Message List: Fix notch appearing on open chat (#1479)

This commit is contained in:
Alexander Zinchuk 2021-09-30 14:03:03 +03:00
parent 609c0cb68e
commit 4d7b16bb88

View File

@ -382,7 +382,7 @@ const MessageList: FC<OwnProps & StateProps & DispatchProps> = ({
}
newScrollTop = scrollHeight - offsetHeight;
scrollOffsetRef.current = Math.max(scrollHeight - newScrollTop, offsetHeight);
scrollOffsetRef.current = Math.max(Math.ceil(scrollHeight - newScrollTop), offsetHeight);
// Scroll still needs to be restored after container resize
if (!shouldForceScroll) {
@ -421,7 +421,7 @@ const MessageList: FC<OwnProps & StateProps & DispatchProps> = ({
newScrollTop = scrollHeight - scrollOffset;
}
resetScroll(container, newScrollTop);
resetScroll(container, Math.ceil(newScrollTop));
if (!memoFocusingIdRef.current) {
isScrollTopJustUpdatedRef.current = true;
@ -430,7 +430,7 @@ const MessageList: FC<OwnProps & StateProps & DispatchProps> = ({
});
}
scrollOffsetRef.current = Math.max(scrollHeight - newScrollTop, offsetHeight);
scrollOffsetRef.current = Math.max(Math.ceil(scrollHeight - newScrollTop), offsetHeight);
if (process.env.APP_ENV === 'perf') {
// eslint-disable-next-line no-console