Fix tagjoinnext

This commit is contained in:
Henrik Giesel 2021-06-27 03:28:45 +02:00
parent 1487ed64c7
commit de10e55265
2 changed files with 6 additions and 3 deletions

View file

@ -145,8 +145,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
return; return;
} }
const spliced = tags.splice(index + 1, 1)[0]; const deleted = deleteTag(tag, index + 1);
tags[index].name = tags[index].name + spliced.name; tag.name = tag.name + deleted.name;
tags = tags; tags = tags;
} }
@ -163,10 +163,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
if (isLast(index)) { if (isLast(index)) {
if (tag.name.length !== 0) { if (tag.name.length !== 0) {
appendEmptyTagAt(index); appendEmptyTagAt(index);
active = null;
activeAfterBlur = index + 1;
} }
return; return;
} }
console.log("movenext", index);
active = null; active = null;
activeAfterBlur = index + 1; activeAfterBlur = index + 1;

View file

@ -57,8 +57,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
async function joinWithNextTag(event: Event): Promise<void> { async function joinWithNextTag(event: Event): Promise<void> {
const length = input.value.length; const length = input.value.length;
dispatch("tagjoinnext"); dispatch("tagjoinnext");
await tick(); await tick();
setPosition(length); setPosition(length);
event.preventDefault(); event.preventDefault();
} }