Browse Source

fix infinite grid scroll condition

Klaudiusz Dembler 4 years ago
parent
commit
71dfd99d85
1 changed files with 1 additions and 2 deletions
  1. 1 2
      src/shared/components/InfiniteVideoGrid/InfiniteVideoGrid.tsx

+ 1 - 2
src/shared/components/InfiniteVideoGrid/InfiniteVideoGrid.tsx

@@ -94,8 +94,7 @@ const InfiniteVideoGrid: React.FC<InfiniteVideoGridProps> = ({
   useEffect(() => {
     const scrollHandler = debounce(() => {
       const scrolledToBottom =
-        window.innerHeight + document.documentElement.scrollTop === document.documentElement.offsetHeight
-
+        window.innerHeight + document.documentElement.scrollTop >= document.documentElement.offsetHeight
       if (scrolledToBottom && ready && !loading && !allVideosLoaded) {
         setTargetRowsCountByCategory((prevState) => ({
           ...prevState,