Merge branch 'feature/scroll-into-view' into develop

This commit is contained in:
2024-02-09 10:43:01 +01:00

View File

@@ -25,7 +25,7 @@ export const MonthCard:FC<MonthCardProps> = ({ yearMonth, children, monthlyExpen
useEffect(() => { useEffect(() => {
if(expanded && elRef.current) { if(expanded && elRef.current) {
// if the element i selected > scroll it into view // if the element i selected > scroll it into view
elRef.current.scrollIntoView({ behavior: 'smooth', block: 'center' }); elRef.current.scrollIntoView({ behavior: 'smooth', block: 'start' });
} }
}, [expanded]); }, [expanded]);