Fix multi select ha-form (#10585)

This commit is contained in:
Bram Kragten 2021-11-09 16:10:26 +01:00 committed by GitHub
parent b74fc5578d
commit 00299bc74d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -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]) => {

View File

@ -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 {