Scroll to Bottom: Fix random stuck position (#6453)

This commit is contained in:
zubiden 2025-11-11 14:37:37 +01:00 committed by Alexander Zinchuk
parent f0c3d78dd1
commit 4180270eb5
2 changed files with 5 additions and 4 deletions

View File

@ -1,23 +1,25 @@
import { memo, useRef } from '@teact';
import { FocusDirection } from '../../types';
import buildClassName from '../../util/buildClassName';
import useFocusMessageListElement from './message/hooks/useFocusMessageListElement';
type OwnProps = {
isJustAdded?: boolean;
isFocused?: boolean;
className?: string;
};
const MessageListBottomMarker = ({ isJustAdded, isFocused, className }: OwnProps) => {
const MessageListBottomMarker = ({ isFocused, className }: OwnProps) => {
const ref = useRef<HTMLDivElement>();
useFocusMessageListElement({
elementRef: ref,
isJustAdded,
isJustAdded: true,
isFocused,
noFocusHighlight: true,
focusDirection: FocusDirection.Down,
});
return (

View File

@ -463,7 +463,6 @@ const MessageListContent = ({
{isViewportNewest && (
<MessageListBottomMarker
key="bottom-marker"
isJustAdded={isNewMessage}
isFocused={shouldScrollToBottom}
className={shouldRenderSponsoredMessage ? 'with-sponsored' : undefined}
/>