From 5fc104f419a77b8458f08082cf185095b8e77738 Mon Sep 17 00:00:00 2001 From: melloware Date: Tue, 11 Oct 2022 13:53:20 -0400 Subject: [PATCH] Fix #3470: Datatable custom restore state column fix --- components/lib/datatable/DataTable.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/lib/datatable/DataTable.js b/components/lib/datatable/DataTable.js index 44682c5b82..8a8e47408b 100644 --- a/components/lib/datatable/DataTable.js +++ b/components/lib/datatable/DataTable.js @@ -314,7 +314,12 @@ export const DataTable = React.forwardRef((props, ref) => { if (props.resizableColumns) { columnWidthsState.current = restoredState.columnWidths; tableWidthState.current = restoredState.tableWidth; - restoreColumnWidths(); + + const isCustom = props.customRestoreState && isCustomStateStorage(); + + if (!isCustom) { + restoreColumnWidths(); + } } if (props.reorderableColumns) {