Shared: Table: fix
This commit is contained in:
parent
308ebd2d8d
commit
d0d03ccd33
@ -86,6 +86,14 @@ class TableHeaderComponent extends React.Component<
|
||||
? localStorage.getItem(columnInfoPanelStorageName)
|
||||
: localStorage.getItem(columnStorageName);
|
||||
|
||||
if (sortBy !== prevProps.sortBy || sorted !== prevProps.sorted) {
|
||||
const columnIndex = columns.findIndex((c) => c?.sortBy === sortBy);
|
||||
|
||||
if (columnIndex > -1 && !columns[columnIndex].enable) {
|
||||
columns[columnIndex].onChange?.(columns[columnIndex].key);
|
||||
}
|
||||
}
|
||||
|
||||
// columns.length + 1 - its settings column
|
||||
if (storageSize && storageSize.split(" ").length !== columns.length + 1) {
|
||||
return this.resetColumns();
|
||||
@ -98,15 +106,6 @@ class TableHeaderComponent 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