From 38a3af698147afc488065981d76d59b8ed255202 Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 24 Mar 2022 09:46:27 -0600 Subject: [PATCH] Set modelValue if the inputWidget has a _callParser() method. This makes sure the internal modelValue is set when we call set_value(), and preserves value if the widget is re-connected (like Et2Dialog does) --- api/js/etemplate/Et2InputWidget/Et2InputWidget.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts b/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts index bb73ec7d95..10113eb331 100644 --- a/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts +++ b/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts @@ -186,6 +186,11 @@ const Et2InputWidgetMixin = (superclass) => set_value(new_value) { this.value = new_value; + + if(typeof this._callParser == "function") + { + this.modelValue = this._callParser(new_value); + } } get_value()