diff --git a/api/js/etemplate/Et2Select/Et2Select.ts b/api/js/etemplate/Et2Select/Et2Select.ts index f7398afd47..864838bee1 100644 --- a/api/js/etemplate/Et2Select/Et2Select.ts +++ b/api/js/etemplate/Et2Select/Et2Select.ts @@ -241,7 +241,7 @@ export class Et2Select extends Et2InvokerMixin(Et2WidgetWithSelect) if(changedProperties.has('select_options') || changedProperties.has("value") || changedProperties.has('empty_label')) { - const valueArray = Array.isArray(this.value) ? this.value : this.value.split(','); + const valueArray = Array.isArray(this.value) ? this.value : (!this.value ? [] : this.value.toString().split(',')); // value not in options AND NOT (having an empty label and value) if(this.select_options.length > 0 && this.select_options.filter((option) => valueArray.find(val => val == option.value)).length === 0 && !(typeof this.empty_label !== 'undefined' && (this.value || "") === ""))