From f2d44190e824a7b787e15b8d7e9e4feb907eb3ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=87?= Date: Fri, 9 Feb 2024 10:42:38 +0100 Subject: [PATCH] fixed scroll into view to scroll to top --- app/ui/MonthCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/ui/MonthCard.tsx b/app/ui/MonthCard.tsx index 09af29f..41e25ed 100644 --- a/app/ui/MonthCard.tsx +++ b/app/ui/MonthCard.tsx @@ -25,7 +25,7 @@ export const MonthCard:FC = ({ yearMonth, children, monthlyExpen useEffect(() => { if(expanded && elRef.current) { // if the element i selected > scroll it into view - elRef.current.scrollIntoView({ behavior: 'smooth', block: 'center' }); + elRef.current.scrollIntoView({ behavior: 'smooth', block: 'start' }); } }, [expanded]);