Fix LinkEntry change caused double change event

This commit is contained in:
nathan 2023-04-28 09:27:17 -06:00
parent 86dac02826
commit 96c66eeaf8

View File

@ -245,7 +245,7 @@ export class Et2LinkEntry extends Et2InputWidget(FormControlMixin(SlotMixin(LitE
protected _bindListeners() protected _bindListeners()
{ {
this._appNode.addEventListener("change", this._handleAppChange); this._appNode.addEventListener("change", this._handleAppChange);
this._searchNode.addEventListener("sl-select", this._handleEntrySelect); this._searchNode.addEventListener("change", this._handleEntrySelect);
this._searchNode.addEventListener("sl-clear", this._handleEntryClear); this._searchNode.addEventListener("sl-clear", this._handleEntryClear);
this.addEventListener("sl-show", this._handleShow); this.addEventListener("sl-show", this._handleShow);
this.addEventListener("sl-hide", this._handleHide); this.addEventListener("sl-hide", this._handleHide);
@ -283,6 +283,7 @@ export class Et2LinkEntry extends Et2InputWidget(FormControlMixin(SlotMixin(LitE
*/ */
protected _handleEntrySelect(event) protected _handleEntrySelect(event)
{ {
event.stopPropagation();
this.classList.add("hideApp"); this.classList.add("hideApp");
this.dispatchEvent(new Event("change")); this.dispatchEvent(new Event("change"));
this.requestUpdate('value'); this.requestUpdate('value');