Skip to content

Commit

Permalink
Fix potential undefined select element in color picker
Browse files Browse the repository at this point in the history
  • Loading branch information
piitaya committed Oct 3, 2024
1 parent 44948a3 commit 50709b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/ha-color-picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ export class HaColorPicker extends LitElement {

@property({ type: Boolean }) public disabled = false;

@query("ha-select") private _select!: HaSelect;
@query("ha-select") private _select?: HaSelect;

connectedCallback(): void {
super.connectedCallback();
// Refresh layout options when the field is connected to the DOM to ensure current value displayed
this._select.layoutOptions();
this._select?.layoutOptions();
}

private _valueSelected(ev) {
Expand Down

0 comments on commit 50709b9

Please sign in to comment.