From 9260f254765c8790696f537d2757446f183f8cc7 Mon Sep 17 00:00:00 2001 From: ralf Date: Mon, 28 Feb 2022 17:42:57 +0200 Subject: [PATCH] fist option with value of 0 was not selected --- 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 6d64da8fda..28f4983171 100644 --- a/api/js/etemplate/Et2Select/Et2Select.ts +++ b/api/js/etemplate/Et2Select/Et2Select.ts @@ -238,7 +238,7 @@ export class Et2Select extends Et2WidgetWithSelect !(typeof this.empty_label !== 'undefined' && (this.modalValue||"") === "")) { // --> use first option - this.modalValue = this.get_select_options()[0]?.value || ""; + this.modalValue = ""+this.get_select_options()[0]?.value; // ""+ to cast value of 0 to "0", to not replace with "" } // Re-set value, the option for it may have just shown up this._inputNode.value = this.modalValue || "";