From de10e55265bb60239aece0edd5c8cab8a6485f90 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Sun, 27 Jun 2021 03:28:45 +0200 Subject: [PATCH] Fix tagjoinnext --- ts/editor/TagEditor.svelte | 7 ++++--- ts/editor/TagInput.svelte | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ts/editor/TagEditor.svelte b/ts/editor/TagEditor.svelte index ed71fb149..177114ff8 100644 --- a/ts/editor/TagEditor.svelte +++ b/ts/editor/TagEditor.svelte @@ -145,8 +145,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html return; } - const spliced = tags.splice(index + 1, 1)[0]; - tags[index].name = tags[index].name + spliced.name; + const deleted = deleteTag(tag, index + 1); + tag.name = tag.name + deleted.name; tags = tags; } @@ -163,10 +163,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html if (isLast(index)) { if (tag.name.length !== 0) { appendEmptyTagAt(index); + active = null; + activeAfterBlur = index + 1; } return; } - console.log("movenext", index); active = null; activeAfterBlur = index + 1; diff --git a/ts/editor/TagInput.svelte b/ts/editor/TagInput.svelte index a25ff555e..d43aae210 100644 --- a/ts/editor/TagInput.svelte +++ b/ts/editor/TagInput.svelte @@ -57,8 +57,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html async function joinWithNextTag(event: Event): Promise { const length = input.value.length; dispatch("tagjoinnext"); + await tick(); setPosition(length); + event.preventDefault(); }