Skip to content

Commit

Permalink
[DataGridPremium] Fix error after closing print export (#11889)
Browse files Browse the repository at this point in the history
  • Loading branch information
cherniavskii authored Feb 5, 2024
1 parent aa87669 commit c1d16ce
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
} from '../../../components/toolbar/GridToolbarExport';
import { getTotalHeaderHeight } from '../columns/gridColumnsUtils';
import { GRID_CHECKBOX_SELECTION_COL_DEF } from '../../../colDef/gridCheckboxSelectionColDef';
import { gridDataRowIdsSelector, gridRowsLookupSelector } from '../rows/gridRowsSelector';

function raf() {
return new Promise<void>((resolve) => {
Expand Down Expand Up @@ -303,7 +304,8 @@ export const useGridPrintExport = (
previousGridState.current = apiRef.current.exportState();
// It appends that the visibility model is not exported, especially if columnVisibility is not controlled
previousColumnVisibility.current = gridColumnVisibilityModelSelector(apiRef);
previousRows.current = apiRef.current.getSortedRows();
const gridRowsLookup = gridRowsLookupSelector(apiRef);
previousRows.current = gridDataRowIdsSelector(apiRef).map((rowId) => gridRowsLookup[rowId]);

if (props.pagination) {
const visibleRowCount = gridExpandedRowCountSelector(apiRef);
Expand Down

0 comments on commit c1d16ce

Please sign in to comment.