diff --git a/surfsense_web/components/ui/animated-tabs.tsx b/surfsense_web/components/ui/animated-tabs.tsx index 58c988a7c..7bc12821f 100644 --- a/surfsense_web/components/ui/animated-tabs.tsx +++ b/surfsense_web/components/ui/animated-tabs.tsx @@ -310,7 +310,8 @@ const TabsList = forwardRef< }, [updateActiveIndicator]); useEffect(() => { - requestAnimationFrame(updateActiveIndicator); + const id = requestAnimationFrame(updateActiveIndicator); + return () => cancelAnimationFrame(id); }, [updateActiveIndicator]); const scrollTabToCenter = useCallback((index: number) => {