Skip to content

Commit

Permalink
Fix delete appearance chip (#22098)
Browse files Browse the repository at this point in the history
* Add filter option to ha-sortable

* Filter chips remove buttons from dragging in ha-entity-state-content-picker
  • Loading branch information
wendevlin authored Sep 26, 2024
1 parent 62cba99 commit ff9af2f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/entity/ha-entity-state-content-picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ class HaEntityStatePicker extends LitElement {
no-style
@item-moved=${this._moveItem}
.disabled=${this.disabled}
filter="button.trailing.action"
>
<ha-chip-set>
${repeat(
Expand Down
10 changes: 10 additions & 0 deletions src/components/ha-sortable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ export class HaSortable extends LitElement {
@property({ type: String, attribute: "handle-selector" })
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 })
public group?: string | SortableInstance.GroupOptions;

Expand Down Expand Up @@ -145,6 +152,9 @@ export class HaSortable extends LitElement {
if (this.group) {
options.group = this.group;
}
if (this.filter) {
options.filter = this.filter;
}

this._sortable = new Sortable(container, options);
}
Expand Down

0 comments on commit ff9af2f

Please sign in to comment.