Revert "Et2Email: Fix validation message for invalid search text did not always show on field blur"

This reverts commit 44f1317873.
This commit is contained in:
nathan 2023-12-19 11:10:03 -07:00
parent 34c6fee46c
commit 1bd7c18403

View File

@ -215,7 +215,7 @@ export class Et2Email extends Et2InputWidget(LitElement) implements SearchMixinI
this.open = false;
this._valueUID = this.egw().uid();
this.updateComplete.then(() => this.makeSortable());
document.addEventListener('focusout', this.handleLostFocus);
document.addEventListener('focusin', this.handleLostFocus);
}
disconnectedCallback()
@ -226,7 +226,7 @@ export class Et2Email extends Et2InputWidget(LitElement) implements SearchMixinI
{
this._sortable.destroy();
}
document.removeEventListener('focusout', this.handleLostFocus);
document.removeEventListener('focusin', this.handleLostFocus);
}
willUpdate(changedProperties : PropertyValues)
@ -587,6 +587,10 @@ export class Et2Email extends Et2InputWidget(LitElement) implements SearchMixinI
* @param {MouseEvent} event
*/
private handleLostFocus = (event : MouseEvent | KeyboardEvent) =>
{
// Close when clicking outside of the component
const path = event.composedPath();
if(this && !path.includes(this))
{
// If they had something OK typed, use it
if(this.addAddress(this._search.value.trim()))
@ -603,6 +607,7 @@ export class Et2Email extends Et2InputWidget(LitElement) implements SearchMixinI
this.value = currentValue;
}
this.hide();
}
};
async handleOpenChange()