diff --git a/CHANGELOG.md b/CHANGELOG.md index f251407addf1..d7e95accd663 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/plugins/discover/public/application/components/default_discover_table/default_discover_table.tsx b/src/plugins/discover/public/application/components/default_discover_table/default_discover_table.tsx index d563f1c1d098..a9552c84350a 100644 --- a/src/plugins/discover/public/application/components/default_discover_table/default_discover_table.tsx +++ b/src/plugins/discover/public/application/components/default_discover_table/default_discover_table.tsx @@ -71,7 +71,7 @@ export const LegacyDiscoverTable = ({ }); const observerRef = useRef(null); const sentinelRef = useRef(null); - + // eslint-disable-next-line react-hooks/exhaustive-deps const loadMoreRows = () => { setRenderedRowCount((prevRowCount) => prevRowCount + 50); // Load 50 more rows }; @@ -96,7 +96,7 @@ export const LegacyDiscoverTable = ({ observerRef.current.unobserve(sentinel); } }; - }, []); + }, [loadMoreRows]); const [activePage, setActivePage] = useState(0); const pageCount = Math.ceil(rows.length / pageSize);