Shared: Table: show column when sorting changed
This commit is contained in:
parent
02ef246e83
commit
87f2991d1c
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user