mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
Update area-filter-dialog.ts
This commit is contained in:
parent
75f18aa69b
commit
a226333c1e
@ -99,11 +99,9 @@ export class DialogAreaFilter
|
|||||||
if (ev.oldIndex === ev.newIndex) return;
|
if (ev.oldIndex === ev.newIndex) return;
|
||||||
|
|
||||||
const areas = this._areas.concat();
|
const areas = this._areas.concat();
|
||||||
const nonHiddenAreas = areas.filter((ar) => !this._hidden.includes(ar));
|
|
||||||
const newIndex = Math.min(ev.newIndex!, nonHiddenAreas.length - 1);
|
|
||||||
|
|
||||||
const option = areas.splice(ev.oldIndex!, 1)[0];
|
const option = areas.splice(ev.oldIndex!, 1)[0];
|
||||||
areas.splice(newIndex, 0, option);
|
areas.splice(ev.newIndex!, 0, option);
|
||||||
|
|
||||||
this._areas = areas;
|
this._areas = areas;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user