mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-05 13:39:23 +01:00
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,14 +448,16 @@ export const Et2WithSearchMixin = <T extends Constructor<LitElement>>(superclass
|
|||||||
this.addEventListener("sl-blur", this._handleSearchAbort);
|
this.addEventListener("sl-blur", this._handleSearchAbort);
|
||||||
this.addEventListener("sl-select", this._handleSelect);
|
this.addEventListener("sl-select", this._handleSelect);
|
||||||
this.addEventListener("sl-clear", this._handleClear)
|
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(() =>
|
this.updateComplete.then(() =>
|
||||||
{
|
{
|
||||||
// Search messes up event order. Since it throws its own bubbling change event,
|
// 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
|
// 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
|
// We catch all change events, then call this._oldChange only when value changes
|
||||||
this.removeEventListener("change", this._oldChange);
|
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);
|
this._searchButtonNode.addEventListener("click", this._handleSearchButtonClick);
|
||||||
|
Loading…
Reference in New Issue
Block a user