From c7764ebebe704678c055bafee367c0d48d45ddb5 Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 21 Nov 2023 13:57:24 -0700 Subject: [PATCH] Et2Select: Better fix for 80ad5dddb2a6fd980c1cad04f1cf77ec7dc52501 which caused problems with selecting options in Et2SelectEmail --- api/js/etemplate/Et2Select/Et2Select.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/api/js/etemplate/Et2Select/Et2Select.ts b/api/js/etemplate/Et2Select/Et2Select.ts index a5668e5bf5..793649bf4f 100644 --- a/api/js/etemplate/Et2Select/Et2Select.ts +++ b/api/js/etemplate/Et2Select/Et2Select.ts @@ -511,17 +511,20 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect) this.updateComplete.then(() => { this.fix_bad_value(); - - - // Force select to stay in sync, avoids value not shown when select options arrive late - if(this.select && this.value !== null && typeof this.value !== "undefined") - { - this.select.value = this.value; - } }); } + } + + update(changedProperties : PropertyValues) + { + super.update(changedProperties); if(changedProperties.has("select_options") && changedProperties.has("value")) { + // Force select to stay in sync, avoids value not shown when select options arrive late + if(this.select && this.value !== null && typeof this.value !== "undefined") + { + this.select.value = this.value; + } } }