diff --git a/src/renderer/components/item-list/item-grid-list/item-grid-list.tsx b/src/renderer/components/item-list/item-grid-list/item-grid-list.tsx index 3a7d39397..b4f78547a 100644 --- a/src/renderer/components/item-list/item-grid-list/item-grid-list.tsx +++ b/src/renderer/components/item-list/item-grid-list/item-grid-list.tsx @@ -265,7 +265,16 @@ export const ItemGridList = ({ [onScrollEnd], ); - const debouncedOnScrollEnd = debounce(handleOnScrollEnd, 150); + const debouncedOnScrollEnd = useMemo( + () => debounce(handleOnScrollEnd, 150), + [handleOnScrollEnd], + ); + + useEffect(() => { + return () => { + debouncedOnScrollEnd.cancel(); + }; + }, [debouncedOnScrollEnd]); const handleScroll = useCallback( (e: UIEvent) => {