forked from extern/egroupware
Et2Select + Search: Always need to bind our own change handler to catch & cancel search textbox changes or they bubble
This commit is contained in:
parent
4936c0e043
commit
dc8809ef87
@ -448,16 +448,18 @@ export const Et2WithSearchMixin = <T extends Constructor<LitElement>>(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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user