+
{#each suggestions as tag}
- {tag}
+ {tag}
{/each}
diff --git a/ts/editor/TagEditor.svelte b/ts/editor/TagEditor.svelte
index 525b98221..ae14c9d8f 100644
--- a/ts/editor/TagEditor.svelte
+++ b/ts/editor/TagEditor.svelte
@@ -8,7 +8,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import Tag from "./Tag.svelte";
import TagInput from "./TagInput.svelte";
- export let tags = ["en::foobar", "zh::あっちこっち"];
+ export let tags = ["en::foobar", "zh::あっちこっち", "test", "def"];
let tagInputNew: HTMLInputElement;
let newName: string = "";
@@ -17,12 +17,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
tagInputNew.focus();
}
- function deleteTag({ detail }: CustomEvent) {
- tags.splice(tags.indexOf(detail.name), 1);
+ function deleteTag(index: number): void {
+ tags.splice(index, 1);
tags = tags;
}
- function addTag() {
+ function addTag(): void {
if (!tags.includes(newName) && newName.length > 0) {
tags.push(newName);
}
@@ -35,11 +35,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
- {#each tags as tag}
-
+ {#each tags as tag, index}
+
deleteTag(index)} />
{/each}
-
+
diff --git a/ts/editor/TagInput.svelte b/ts/editor/TagInput.svelte
index 73b7436ef..0cc88bea2 100644
--- a/ts/editor/TagInput.svelte
+++ b/ts/editor/TagInput.svelte
@@ -3,8 +3,6 @@ Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->