Skip to content

Commit

Permalink
Fix scroll position when modal opens
Browse files Browse the repository at this point in the history
  • Loading branch information
sashachabin committed Aug 26, 2024
1 parent bd729bf commit 99fd767
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/components/UI/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ export function Modal({
};

useEffect(() => {
ref.current.showModal();
if (refInner.current) {
refInner.current.scrollTo(0, 0);
}
ref.current.showModal();
(document.activeElement as HTMLElement).blur();
}, []);

Expand Down

0 comments on commit 99fd767

Please sign in to comment.