From 0b547c921dbadfdd58f110a78bddfd6c40d7ff52 Mon Sep 17 00:00:00 2001 From: ralf Date: Sun, 29 May 2022 09:53:41 +0200 Subject: [PATCH] fix error for typeof this.value !== 'string', eg. number, undefined, ... --- api/js/etemplate/Et2Select/Et2Select.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 || "") === ""))