Shared:Components:Table:Fixed incorrect table header column size calculation when the table changes view to display with columns from display without columns.

This commit is contained in:
Vlada Gazizova 2024-05-02 17:34:31 +03:00
parent 30fe69271b
commit c6f327d279

View File

@ -1521,6 +1521,19 @@ class TableHeader extends React.Component<
} else if (item !== `${settingsSize}px`) {
const percent = (getSubstring(item) / oldWidth) * 100;
if (percent === 100) {
const enableColumnsLength = columns.filter(
(column) => !column.defaultSize && column.enable,
).length;
if (enableColumnsLength !== 1) {
localStorage.removeItem(columnStorageName);
this.resetColumns();
return;
}
}
let newItemWidth = defaultColumnSize
? `${defaultColumnSize}px`
: percent === 0