Fix unhiding default hidden columns (#21354)

* Fix unhiding default hidden columns

* Update dialog-data-table-settings.ts
This commit is contained in:
Bram Kragten 2024-07-10 14:58:26 +02:00 committed by GitHub
parent daa36788e0
commit cd4937b539
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -193,6 +193,7 @@ export class DialogDataTableSettings extends LitElement {
.filter(([_key, col]) => col.defaultHidden)
.map(([key]) => key)),
];
if (wasHidden && hidden.includes(column)) {
hidden.splice(hidden.indexOf(column), 1);
} else if (!wasHidden) {
@ -235,14 +236,14 @@ export class DialogDataTableSettings extends LitElement {
}
columns.forEach((col) => {
if (!newOrder.includes(col.key)) {
if (col.key !== column && !newOrder.includes(col.key)) {
if (col.moveable === false) {
newOrder.unshift(col.key);
} else {
newOrder.splice(lastMoveable + 1, 0, col.key);
}
if (col.defaultHidden) {
if (col.defaultHidden && !hidden.includes(col.key)) {
hidden.push(col.key);
}
}