From 99fd767729fb6368709806bc6df899ada30a1a88 Mon Sep 17 00:00:00 2001 From: Sasha Chabin Date: Tue, 27 Aug 2024 02:01:00 +0500 Subject: [PATCH] Fix scroll position when modal opens --- client/components/UI/Modal/Modal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/components/UI/Modal/Modal.tsx b/client/components/UI/Modal/Modal.tsx index 6fae2b6..f1e496d 100644 --- a/client/components/UI/Modal/Modal.tsx +++ b/client/components/UI/Modal/Modal.tsx @@ -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(); }, []);