diff --git a/api/js/etemplate/Et2Select/SearchMixin.ts b/api/js/etemplate/Et2Select/SearchMixin.ts index 558f56c25a..7a7e1ea95b 100644 --- a/api/js/etemplate/Et2Select/SearchMixin.ts +++ b/api/js/etemplate/Et2Select/SearchMixin.ts @@ -448,16 +448,18 @@ export const Et2WithSearchMixin = >(superclass this.addEventListener("sl-blur", this._handleSearchAbort); this.addEventListener("sl-select", this._handleSelect); this.addEventListener("sl-clear", this._handleClear) + + // Need our own change to catch the change event from search input + this.addEventListener("change", this._handleChange); + this.updateComplete.then(() => { // Search messes up event order. Since it throws its own bubbling change event, // selecting an option fires 2 change events - 1 before the widget is finished adjusting, losing the value // We catch all change events, then call this._oldChange only when value changes this.removeEventListener("change", this._oldChange); - // Need our own change to catch the change event from search input - this.addEventListener("change", this._handleChange); }); - + this._searchButtonNode.addEventListener("click", this._handleSearchButtonClick); }