Fix email tags could not be edited inside Et2Email

They could, but the change was ignored for the first tag
This commit is contained in:
nathan 2023-12-19 11:38:54 -07:00 committed by ralf
parent 197e321905
commit 0dfeae9b16
2 changed files with 5 additions and 1 deletions

View File

@ -297,6 +297,7 @@ export class Et2Email extends Et2InputWidget(LitElement) implements SearchMixinI
pull: pull,
put: !(this.readonly || this.disabled)
},
// filter: "[isEditing],.et2-no-drag",
onEnd: this.handleSortEnd
});
}
@ -905,7 +906,7 @@ export class Et2Email extends Et2InputWidget(LitElement) implements SearchMixinI
handleTagChange(event)
{
// Need to update our value, or it will just redo the tag with the old value
if(event.originalValue && this.value.indexOf(event.originalValue))
if(event.originalValue && this.value.includes(event.originalValue))
{
let index = this.value.indexOf(event.originalValue);
this.value[index] = event.target.value;

View File

@ -176,6 +176,7 @@ export class Et2Tag extends Et2Widget(SlTag)
<et2-textbox value="${this.value}"
@sl-change=${this.handleChange}
@blur=${this.stopEdit}
@mousedown=${e => e.stopPropagation()}
@click=${e => e.stopPropagation()}
@keydown=${this.handleKeyDown}
></et2-textbox>
@ -199,6 +200,7 @@ export class Et2Tag extends Et2Widget(SlTag)
}
this.getRootNode().host.hide()
this.isEditing = true;
this.setAttribute("isEditing", "");
this.requestUpdate();
this.updateComplete.then(() =>
{
@ -209,6 +211,7 @@ export class Et2Tag extends Et2Widget(SlTag)
stopEdit()
{
this.isEditing = false;
this.removeAttribute("isEditing");
let event = new Event("change", {
bubbles: true
});