mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 03:36:44 +00:00
Fix unhiding default hidden columns (#21354)
* Fix unhiding default hidden columns * Update dialog-data-table-settings.ts
This commit is contained in:
parent
daa36788e0
commit
cd4937b539
@ -193,6 +193,7 @@ export class DialogDataTableSettings extends LitElement {
|
|||||||
.filter(([_key, col]) => col.defaultHidden)
|
.filter(([_key, col]) => col.defaultHidden)
|
||||||
.map(([key]) => key)),
|
.map(([key]) => key)),
|
||||||
];
|
];
|
||||||
|
|
||||||
if (wasHidden && hidden.includes(column)) {
|
if (wasHidden && hidden.includes(column)) {
|
||||||
hidden.splice(hidden.indexOf(column), 1);
|
hidden.splice(hidden.indexOf(column), 1);
|
||||||
} else if (!wasHidden) {
|
} else if (!wasHidden) {
|
||||||
@ -235,14 +236,14 @@ export class DialogDataTableSettings extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
columns.forEach((col) => {
|
columns.forEach((col) => {
|
||||||
if (!newOrder.includes(col.key)) {
|
if (col.key !== column && !newOrder.includes(col.key)) {
|
||||||
if (col.moveable === false) {
|
if (col.moveable === false) {
|
||||||
newOrder.unshift(col.key);
|
newOrder.unshift(col.key);
|
||||||
} else {
|
} else {
|
||||||
newOrder.splice(lastMoveable + 1, 0, col.key);
|
newOrder.splice(lastMoveable + 1, 0, col.key);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (col.defaultHidden) {
|
if (col.defaultHidden && !hidden.includes(col.key)) {
|
||||||
hidden.push(col.key);
|
hidden.push(col.key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user