From 0c8824c496b2227460942309e1e1bdadacd85f7d Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 1 Apr 2022 11:12:19 -0600 Subject: [PATCH] Fix addressbook contact type filter was sometimes 'D' after being initialized to 'n' When nextmatch moved the template in the DOM, we were re-adding already existing options which re-set the value. --- api/js/etemplate/Et2Select/Et2Select.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/Et2Select/Et2Select.ts b/api/js/etemplate/Et2Select/Et2Select.ts index 258f90060e..6f308ba903 100644 --- a/api/js/etemplate/Et2Select/Et2Select.ts +++ b/api/js/etemplate/Et2Select/Et2Select.ts @@ -80,10 +80,15 @@ export class Et2Select extends Et2InvokerMixin(Et2WidgetWithSelect) { super.connectedCallback(); //MOVE options that were set as children inside SELECT: - this.querySelector('select').append(...this.querySelectorAll('option')); + //this.querySelector('select').append(...this.querySelectorAll('option')); + } + + firstUpdated(changedProperties) + { + super.firstUpdated(changedProperties); // if _inputNode was not available by the time set_value() got called - if(this.getValue() !== this.modelValue) + if(this.getValue() !== this.value) { this.set_value(this.modelValue); }