mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-07 01:50:31 +00:00
Handle automation and dashboard drag and drop at the element level (#22300)
* Handle drag and drop at action, condition, trigger level * Clean item path * Clean item path * Fix selectors * Clean selector config * Remove enhancedSelector * Add option row component * Fix DnD inside option sequence or condition * Add comments * Remove item path logic from the dashboard too * Fix floor/area drag and drop * Avoid UI jump in area dashboard * Remove unused import * Add comment
This commit is contained in:
@@ -15,7 +15,6 @@ import {
|
||||
extractSearchParam,
|
||||
removeSearchParam,
|
||||
} from "../../../common/url/search-params";
|
||||
import { nestedArrayMove } from "../../../common/util/array-move";
|
||||
import "../../../components/ha-card";
|
||||
import "../../../components/ha-icon-button";
|
||||
import "../../../components/ha-markdown";
|
||||
@@ -163,7 +162,6 @@ export class HaManualScriptEditor extends LitElement {
|
||||
.actions=${this.config.sequence || []}
|
||||
.path=${["sequence"]}
|
||||
@value-changed=${this._sequenceChanged}
|
||||
@item-moved=${this._itemMoved}
|
||||
.hass=${this.hass}
|
||||
.narrow=${this.narrow}
|
||||
.disabled=${this.disabled}
|
||||
@@ -185,21 +183,6 @@ export class HaManualScriptEditor extends LitElement {
|
||||
});
|
||||
}
|
||||
|
||||
private _itemMoved(ev: CustomEvent): void {
|
||||
ev.stopPropagation();
|
||||
const { oldIndex, newIndex, oldPath, newPath } = ev.detail;
|
||||
const updatedConfig = nestedArrayMove(
|
||||
this.config,
|
||||
oldIndex,
|
||||
newIndex,
|
||||
oldPath,
|
||||
newPath
|
||||
);
|
||||
fireEvent(this, "value-changed", {
|
||||
value: updatedConfig,
|
||||
});
|
||||
}
|
||||
|
||||
static get styles(): CSSResultGroup {
|
||||
return [
|
||||
haStyle,
|
||||
|
||||
Reference in New Issue
Block a user