Shared: Table: show column when sorting changed

This commit is contained in:
Viktor Fomin 2024-07-22 15:20:20 +03:00
parent 02ef246e83
commit 87f2991d1c

View File

@ -76,6 +76,8 @@ class TableHeader extends React.Component<
infoPanelVisible,
columnStorageName,
columnInfoPanelStorageName,
sortBy,
sorted,
} = this.props;
if (columnStorageName === prevProps.columnStorageName) {
@ -95,6 +97,15 @@ class TableHeader extends React.Component<
}
}
if (sortBy !== prevProps.sortBy || sorted !== prevProps.sorted) {
const columnIndex = columns.findIndex((c) => c?.sortBy === sortBy);
if (columnIndex === -1) return;
if (!columns[columnIndex].enable) {
columns[columnIndex].onChange?.(columns[columnIndex].key);
}
}
this.onResize();
}