Merge pull request #391 from ONLYOFFICE/bugfix/table-add-column

bugfix/table-add-column
This commit is contained in:
Nikita Gopienko 2024-05-02 17:56:01 +03:00 committed by GitHub
commit 62b61487dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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