mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 00:58:55 +01:00
Et2Email: Show validation error for partially typed (not yet accepted) email addresses
This commit is contained in:
parent
d28fbfeab3
commit
c26b13986c
@ -215,6 +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('focusin', this.handleLostFocus);
|
||||
}
|
||||
|
||||
disconnectedCallback()
|
||||
@ -225,6 +226,7 @@ export class Et2Email extends Et2InputWidget(LitElement) implements SearchMixinI
|
||||
{
|
||||
this._sortable.destroy();
|
||||
}
|
||||
document.removeEventListener('focusin', this.handleLostFocus);
|
||||
}
|
||||
|
||||
willUpdate(changedProperties : PropertyValues)
|
||||
@ -261,13 +263,11 @@ export class Et2Email extends Et2InputWidget(LitElement) implements SearchMixinI
|
||||
|
||||
private addOpenListeners()
|
||||
{
|
||||
document.addEventListener('focusin', this.handleLostFocus);
|
||||
document.addEventListener('mousedown', this.handleLostFocus);
|
||||
}
|
||||
|
||||
private removeOpenListeners()
|
||||
{
|
||||
document.removeEventListener('focusin', this.handleLostFocus);
|
||||
document.removeEventListener('mousedown', this.handleLostFocus);
|
||||
}
|
||||
|
||||
@ -594,6 +594,15 @@ export class Et2Email extends Et2InputWidget(LitElement) implements SearchMixinI
|
||||
{
|
||||
this._search.value = "";
|
||||
}
|
||||
else if(this._search.value)
|
||||
{
|
||||
// Invalid input, show message
|
||||
// Can't just call this.validate() since the input is not part of the value
|
||||
let currentValue = this.value;
|
||||
this.value = [this._search.value];
|
||||
this.validate();
|
||||
this.value = currentValue;
|
||||
}
|
||||
this.hide();
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user