Skip to content

Commit

Permalink
[BUG] Resolve initial infinity scroll loading issue
Browse files Browse the repository at this point in the history
Issue Resolve
#6033

Signed-off-by: Anan Zhuang <[email protected]>
  • Loading branch information
ananzh committed Mar 5, 2024
1 parent d822b33 commit dba43d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [Discover] Fix table cell content overflowing in Safari ([#5948](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5948))
- [BUG][MD]Fix schema for test connection to separate validation based on auth type ([#5997](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5997))
- [Discover] Enable 'Back to Top' Feature in Discover for scrolling to top ([#6008](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6008))
- [Discover] Resolve initial infinity scroll loading issue ([#6034](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6034))

### 🚞 Infrastructure

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const LegacyDiscoverTable = ({
});
const observerRef = useRef<IntersectionObserver | null>(null);
const sentinelRef = useRef<HTMLDivElement | null>(null);

// eslint-disable-next-line react-hooks/exhaustive-deps
const loadMoreRows = () => {
setRenderedRowCount((prevRowCount) => prevRowCount + 50); // Load 50 more rows
};
Expand All @@ -96,7 +96,7 @@ export const LegacyDiscoverTable = ({
observerRef.current.unobserve(sentinel);
}
};
}, []);
}, [loadMoreRows]);

const [activePage, setActivePage] = useState(0);
const pageCount = Math.ceil(rows.length / pageSize);
Expand Down

0 comments on commit dba43d5

Please sign in to comment.