diff --git a/surfsense_web/components/ui/animated-tabs.tsx b/surfsense_web/components/ui/animated-tabs.tsx index 43ae82121..52e2342c9 100644 --- a/surfsense_web/components/ui/animated-tabs.tsx +++ b/surfsense_web/components/ui/animated-tabs.tsx @@ -306,7 +306,8 @@ const TabsList = forwardRef< }, [updateActiveIndicator]); useEffect(() => { - requestAnimationFrame(updateActiveIndicator); + const frameId = requestAnimationFrame(updateActiveIndicator); + return () => cancelAnimationFrame(frameId); }, [updateActiveIndicator]); const scrollTabToCenter = useCallback((index: number) => {