Skip to content

Commit

Permalink
Fix label selector when required (#23186)
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten committed Dec 6, 2024
1 parent f3e0df9 commit 7f31acf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/ha-form/compute-initial-ha-form-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export const computeInitialHaFormData = (
data[field.name] = selector.entity?.multiple ? [] : "";
} else if ("area" in selector) {
data[field.name] = selector.area?.multiple ? [] : "";
} else if ("label" in selector) {
data[field.name] = selector.label?.multiple ? [] : "";
} else if ("boolean" in selector) {
data[field.name] = false;
} else if (
Expand Down
2 changes: 2 additions & 0 deletions src/components/ha-selector/ha-selector-label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class HaLabelSelector extends LitElement {
no-add
.hass=${this.hass}
.value=${ensureArray(this.value ?? [])}
.required=${this.required}
.disabled=${this.disabled}
.label=${this.label}
@value-changed=${this._handleChange}
Expand All @@ -46,6 +47,7 @@ export class HaLabelSelector extends LitElement {
no-add
.hass=${this.hass}
.value=${this.value}
.required=${this.required}
.disabled=${this.disabled}
.label=${this.label}
@value-changed=${this._handleChange}
Expand Down

0 comments on commit 7f31acf

Please sign in to comment.