File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -687,13 +687,18 @@ export const EuiDataGrid: FunctionComponent<EuiDataGridProps> = (props) => {
687687 // this triggers a double re-render when the grid is switched from constrained to unconstrained
688688 // but in reality ... maybe don't do that?
689689 const [ gridHeight , setGridHeight ] = useState ( IS_JEST_ENVIRONMENT ? 500 : 0 ) ;
690+ const pageSize = pagination ?. pageSize ;
690691 useEffect ( ( ) => {
691692 if ( height == null ) {
692693 // if already 0 this update will be ignored
693694 // if not already 0, this resets the height constraint so a new value can be observed
694695 setGridHeight ( 0 ) ;
695696 }
696- } , [ height , pagination ?. pageSize ] ) ;
697+ } , [
698+ height ,
699+ pageSize ,
700+ rowCount , // recompute height if the rowCount changes
701+ ] ) ;
697702
698703 const [ containerRef , _setContainerRef ] = useState < HTMLDivElement | null > (
699704 null
You can’t perform that action at this time.
0 commit comments