mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 02:36:37 +00:00
Fix delete appearance chip (#22098)
* Add filter option to ha-sortable * Filter chips remove buttons from dragging in ha-entity-state-content-picker
This commit is contained in:
parent
62cba99491
commit
ff9af2f980
@ -173,6 +173,7 @@ class HaEntityStatePicker extends LitElement {
|
|||||||
no-style
|
no-style
|
||||||
@item-moved=${this._moveItem}
|
@item-moved=${this._moveItem}
|
||||||
.disabled=${this.disabled}
|
.disabled=${this.disabled}
|
||||||
|
filter="button.trailing.action"
|
||||||
>
|
>
|
||||||
<ha-chip-set>
|
<ha-chip-set>
|
||||||
${repeat(
|
${repeat(
|
||||||
|
@ -43,6 +43,13 @@ export class HaSortable extends LitElement {
|
|||||||
@property({ type: String, attribute: "handle-selector" })
|
@property({ type: String, attribute: "handle-selector" })
|
||||||
public handleSelector?: string;
|
public handleSelector?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Selectors that do not lead to dragging (String or Function)
|
||||||
|
* https://github.com/SortableJS/Sortable?tab=readme-ov-file#filter-option
|
||||||
|
* */
|
||||||
|
@property({ type: String, attribute: "filter" })
|
||||||
|
public filter?: string;
|
||||||
|
|
||||||
@property({ type: String })
|
@property({ type: String })
|
||||||
public group?: string | SortableInstance.GroupOptions;
|
public group?: string | SortableInstance.GroupOptions;
|
||||||
|
|
||||||
@ -145,6 +152,9 @@ export class HaSortable extends LitElement {
|
|||||||
if (this.group) {
|
if (this.group) {
|
||||||
options.group = this.group;
|
options.group = this.group;
|
||||||
}
|
}
|
||||||
|
if (this.filter) {
|
||||||
|
options.filter = this.filter;
|
||||||
|
}
|
||||||
|
|
||||||
this._sortable = new Sortable(container, options);
|
this._sortable = new Sortable(container, options);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user