Fix timeline scrolling automatically while emoji picker is open
This commit is contained in:
parent
01231eb1c6
commit
f115ba5873
5 changed files with 150 additions and 11 deletions
|
@ -33,6 +33,7 @@ import {
|
|||
} from '../../hooks/useKeyboardShortcuts';
|
||||
import { PanelType } from '../../types/Panels';
|
||||
import type { DeleteMessagesPropsType } from '../../state/ducks/globalModals';
|
||||
import { useScrollerLock } from '../../hooks/useScrollLock';
|
||||
|
||||
export type PropsData = {
|
||||
canDownload: boolean;
|
||||
|
@ -175,6 +176,14 @@ export function TimelineMessage(props: Props): JSX.Element {
|
|||
[reactionPickerRoot]
|
||||
);
|
||||
|
||||
useScrollerLock({
|
||||
reason: 'TimelineMessage reactionPicker',
|
||||
lockScrollWhen: reactionPickerRoot != null,
|
||||
onUserInterrupt() {
|
||||
toggleReactionPicker(true);
|
||||
},
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
let cleanUpHandler: (() => void) | undefined;
|
||||
if (reactionPickerRoot) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue