diff --git a/app/soapbox/components/scrollable_list.tsx b/app/soapbox/components/scrollable_list.tsx index ae9b861e9..510f186af 100644 --- a/app/soapbox/components/scrollable_list.tsx +++ b/app/soapbox/components/scrollable_list.tsx @@ -1,4 +1,4 @@ -import { throttle } from 'lodash'; +import { debounce } from 'lodash'; import React, { useEffect, useRef, useMemo, useCallback } from 'react'; import { useHistory } from 'react-router-dom'; import { Virtuoso, Components, VirtuosoProps, VirtuosoHandle, ListRange, IndexLocationWithAlign } from 'react-virtuoso'; @@ -106,7 +106,7 @@ const ScrollableList = React.forwardRef(({ data.push(); } - const handleScroll = useCallback(throttle(() => { + const handleScroll = useCallback(debounce(() => { // HACK: Virtuoso has no better way to get this... const node = document.querySelector(`[data-virtuoso-scroller] [data-item-index="${topIndex.current}"]`); if (node) {