From 0dfeae9b1637b403f783b606d02f44ae22d805d8 Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 19 Dec 2023 11:38:54 -0700 Subject: [PATCH] Fix email tags could not be edited inside Et2Email They could, but the change was ignored for the first tag --- api/js/etemplate/Et2Email/Et2Email.ts | 3 ++- api/js/etemplate/Et2Select/Tag/Et2Tag.ts | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/Et2Email/Et2Email.ts b/api/js/etemplate/Et2Email/Et2Email.ts index 5116f6551d..a58c643dbf 100644 --- a/api/js/etemplate/Et2Email/Et2Email.ts +++ b/api/js/etemplate/Et2Email/Et2Email.ts @@ -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; diff --git a/api/js/etemplate/Et2Select/Tag/Et2Tag.ts b/api/js/etemplate/Et2Select/Tag/Et2Tag.ts index e87e8c35ef..d80812d675 100644 --- a/api/js/etemplate/Et2Select/Tag/Et2Tag.ts +++ b/api/js/etemplate/Et2Select/Tag/Et2Tag.ts @@ -176,6 +176,7 @@ export class Et2Tag extends Et2Widget(SlTag) e.stopPropagation()} @click=${e => e.stopPropagation()} @keydown=${this.handleKeyDown} > @@ -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 });