From 5349c7a96642dab9e2a41c1e594f7188d1d242bd Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 20 Sep 2023 08:20:22 -0600 Subject: [PATCH] Fix selects with no emptyLabel but an option with value="" did not return a value --- api/js/etemplate/Et2Select/Et2Select.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/Et2Select/Et2Select.ts b/api/js/etemplate/Et2Select/Et2Select.ts index eb7b747e97..62c8d2cf96 100644 --- a/api/js/etemplate/Et2Select/Et2Select.ts +++ b/api/js/etemplate/Et2Select/Et2Select.ts @@ -377,11 +377,12 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect) get value() { // Handle a bunch of non-values, if it's multiple we want an array - if(this.multiple && (this.__value == "null" || this.__value == null || typeof this.__value == "undefined" || !this.emptyLabel && this.__value == "")) + if(this.multiple && (this.__value == "null" || this.__value == null || typeof this.__value == "undefined" || + !this.emptyLabel && this.__value == "" && !this.select_options.find(o => o.value == ""))) { return []; } - if(!this.multiple && !this.emptyLabel && this.__value == "") + if(!this.multiple && !this.emptyLabel && this.__value == "" && !this.select_options.find(o => o.value == "")) { return null; }