diff --git a/CHANGELOG.md b/CHANGELOG.md index a6983a77..00ac2c63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). Links "DE#nnn" prior to version 2.0 point to the Dash Enterprise closed-source Dash AG Grid repo ## [unreleased] + ### Added - [#453](https://github.com/plotly/dash-ag-grid/pull/453) Test for changelog entry @@ -17,6 +18,7 @@ Links "DE#nnn" prior to version 2.0 point to the Dash Enterprise closed-source D - [#454](https://github.com/plotly/dash-ag-grid/pull/454) fixes issue where a rowCount of 0 would cause the grid not to display new data - [#459](https://github.com/plotly/dash-ag-grid/pull/459) removes `getRowsRequest` / `getRowsResponse` warnings by excluding these Dash callback props from AG Grid options. - [#460](https://github.com/plotly/dash-ag-grid/pull/460) fix grid rendering when `getRowId` is explicitly set to `None` +- [#466](https://github.com/plotly/dash-ag-grid/issues/466) guard against a null `gridApi` in `onSortChanged`, which threw an uncaught `TypeError` when a grid initialized with a sort applied via `initialState.sort.sortModel` ## [35.2.0] - 2026-04-03 ### Added diff --git a/src/lib/fragments/AgGrid.react.js b/src/lib/fragments/AgGrid.react.js index 0ca51e81..0d6e928e 100644 --- a/src/lib/fragments/AgGrid.react.js +++ b/src/lib/fragments/AgGrid.react.js @@ -756,7 +756,7 @@ export function DashAgGrid(props) { if (rowModelType === 'clientSide') { propsToSet.virtualRowData = virtualRowData(); } - if (!gridApi.isDestroyed()) { + if (gridApi && !gridApi?.isDestroyed()) { propsToSet.columnState = JSON.parse( JSON.stringify(gridApi.getColumnState()) );