diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d869121f8f..50f511ab3b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Fixed bug in `EuiCodeBlock` content overlapping with control buttons when `whiteSpace` was set to `"pre"` ([#3853](https://github.com/elastic/eui/pull/3853)) - Fixed `EuiFocusTrap` not applying provided `style` prop ([#3916](https://github.com/elastic/eui/pull/3916)) +- Fixed bug in `EuiDataGrid` when a new pagination object would cause every cell to render ([#3919](https://github.com/elastic/eui/pull/3919)) ## [`28.0.0`](https://github.com/elastic/eui/tree/v28.0.0) diff --git a/src/components/datagrid/data_grid.tsx b/src/components/datagrid/data_grid.tsx index d8a38df9b37..957f3d5bf59 100644 --- a/src/components/datagrid/data_grid.tsx +++ b/src/components/datagrid/data_grid.tsx @@ -886,17 +886,15 @@ export const EuiDataGrid: FunctionComponent = props => { const datagridContext = useMemo( () => ({ onFocusUpdate: (cell: EuiDataGridFocusedCell, updateFocus: Function) => { - if (pagination) { - const key = `${cell[0]}-${cell[1]}`; - cellsUpdateFocus.current.set(key, updateFocus); + const key = `${cell[0]}-${cell[1]}`; + cellsUpdateFocus.current.set(key, updateFocus); - return () => { - cellsUpdateFocus.current.delete(key); - }; - } + return () => { + cellsUpdateFocus.current.delete(key); + }; }, }), - [pagination] + [] ); const gridIds = htmlIdGenerator();