diff --git a/src/components/tool-settings/History.tsx b/src/components/tool-settings/History.tsx index 49e4e00..5079cbb 100644 --- a/src/components/tool-settings/History.tsx +++ b/src/components/tool-settings/History.tsx @@ -16,9 +16,15 @@ const iconMap = { function History() { const { history, currentIndex, jumpTo } = useContext(HistoryContext); + const divRef = useRef(null); + + useEffect(() => { + divRef.current?.scrollIntoView(false); + }, [history]); + return ( -
+
{history.map(({ name }, index) => { const IconComponent = iconMap[name as keyof typeof iconMap];