Scroll to Bottom: Fix random stuck position (#6453)
This commit is contained in:
parent
f0c3d78dd1
commit
4180270eb5
@ -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 (
|
||||
|
||||
@ -463,7 +463,6 @@ const MessageListContent = ({
|
||||
{isViewportNewest && (
|
||||
<MessageListBottomMarker
|
||||
key="bottom-marker"
|
||||
isJustAdded={isNewMessage}
|
||||
isFocused={shouldScrollToBottom}
|
||||
className={shouldRenderSponsoredMessage ? 'with-sponsored' : undefined}
|
||||
/>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user