Skip to content

Commit

Permalink
Fix multi select ha-form (#10585)
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten authored Nov 9, 2021
1 parent b74fc55 commit 00299bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/ha-form/ha-form-multi_select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ export class HaFormMultiSelect extends LitElement implements HaFormElement {
}

protected render(): TemplateResult {
const options = Object.entries(this.schema.options);
const options = Array.isArray(this.schema.options)
? this.schema.options
: Object.entries(this.schema.options);
const data = this.data || [];

const renderedOptions = options.map((item: string | [string, string]) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ha-form/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export interface HaFormSelectSchema extends HaFormBaseSchema {

export interface HaFormMultiSelectSchema extends HaFormBaseSchema {
type: "multi_select";
options: Record<string, string>;
options: Record<string, string> | string[];
}

export interface HaFormFloatSchema extends HaFormBaseSchema {
Expand Down

0 comments on commit 00299bc

Please sign in to comment.