diff --git a/ts/editor/Tag.svelte b/ts/editor/Tag.svelte index e057db70b..3116511e8 100644 --- a/ts/editor/Tag.svelte +++ b/ts/editor/Tag.svelte @@ -21,21 +21,25 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html } } - function tagDelete(event: Event): void { + function deleteTag(event: Event): void { dispatch("tagdelete", { name }); event.stopPropagation(); } + + function updateTag() { + active = false; + } {#if active} - (active = false)} /> + (active = false)} on:update={updateTag} /> {:else} {name} - {@html deleteIcon} diff --git a/ts/editor/TagInput.svelte b/ts/editor/TagInput.svelte index 4b09f2578..8785f4292 100644 --- a/ts/editor/TagInput.svelte +++ b/ts/editor/TagInput.svelte @@ -34,6 +34,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html } else if (event.code === "Backspace" && name.endsWith("::")) { name = name.slice(0, -2); event.preventDefault(); + } else if (event.code === "Enter") { + onAccept(event); + event.preventDefault(); } } diff --git a/ts/editor/TagInputEdit.svelte b/ts/editor/TagInputEdit.svelte index 2c3c3328f..f9dbcc4be 100644 --- a/ts/editor/TagInputEdit.svelte +++ b/ts/editor/TagInputEdit.svelte @@ -26,16 +26,15 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html console.log("onkeydown"); } - function stopPropagation(event: Event): void { - event.stopPropagation(); - } + /* function stopPropagation(event: Event): void { */ + /* event.stopPropagation(); */ + /* } */