File tree Expand file tree Collapse file tree
packages/pluggableWidgets/datagrid-web/src/model Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,21 +42,7 @@ export function useInfiniteControl(): [trackTableScrolling: ((e: any) => void) |
4242 ) ;
4343
4444 useEffect ( ( ) => {
45- const timer = setTimeout ( ( ) => {
46- if ( ! isVisible ) {
47- return ;
48- }
49- const wasLocked = gridSizeStore . gridContainerHeight !== undefined ;
50- gridSizeStore . lockGridContainerHeight ( ) ;
51- const justLocked = ! wasLocked && gridSizeStore . gridContainerHeight !== undefined ;
52-
53- if ( justLocked ) {
54- const gridBody = gridSizeStore . gridBodyRef . current ;
55- if ( gridBody && gridSizeStore . hasMoreItems && gridBody . scrollHeight <= gridBody . clientHeight ) {
56- gridSizeStore . bumpPage ( ) ;
57- }
58- }
59- } , 100 ) ;
45+ const timer = setTimeout ( ( ) => isVisible && gridSizeStore . lockGridContainerHeight ( ) , 100 ) ;
6046 return ( ) => clearTimeout ( timer ) ;
6147 } ) ;
6248
Original file line number Diff line number Diff line change @@ -112,5 +112,10 @@ export class GridSizeStore {
112112 const overflows = gridContainer . scrollHeight > fullHeight ;
113113 this . gridContainerHeight = fullHeight - ( overflows ? 0 : VIRTUAL_SCROLLING_OFFSET ) ;
114114 this . lockedAtPageSize = currentPageSize ;
115+
116+ const gridBody = this . gridBodyRef . current ;
117+ if ( this . hasMoreItems && gridBody && gridBody . scrollHeight <= gridBody . clientHeight ) {
118+ this . bumpPage ( ) ;
119+ }
115120 }
116121}
You can’t perform that action at this time.
0 commit comments