File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
packages/x-data-grid/src/hooks/features/export Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -279,15 +279,17 @@ export const useGridPrintExport = (
279279
280280 // Revert grid to previous state
281281 apiRef . current . restoreState ( previousGridState . current || { } ) ;
282+
282283 if ( ! previousGridState . current ?. columns ?. columnVisibilityModel ) {
283- // if the apiRef.current.exportState(); did not exported the column visibility, we update it
284+ // if the apiRef.current.exportState(); did not export the column visibility, we update it
284285 apiRef . current . setColumnVisibilityModel ( previousColumnVisibility . current ) ;
285286 }
286287
287288 apiRef . current . setState ( ( state ) => ( {
288289 ...state ,
289290 virtualization : previousVirtualizationState . current ! ,
290291 } ) ) ;
292+
291293 apiRef . current . setRows ( previousRows . current ) ;
292294
293295 // Clear local state
@@ -333,14 +335,8 @@ export const useGridPrintExport = (
333335 } ) ) ;
334336 }
335337 previousVirtualizationState . current = apiRef . current . state . virtualization ;
336- apiRef . current . setState ( ( state ) => ( {
337- ...state ,
338- virtualization : {
339- ...state . virtualization ,
340- enabled : false ,
341- enabledForColumns : false ,
342- } ,
343- } ) ) ;
338+
339+ apiRef . current . unstable_setVirtualization ( false ) ;
344340
345341 await updateGridColumnsForPrint (
346342 options ?. fields ,
You can’t perform that action at this time.
0 commit comments