From 68bbc8d25dab5ef183b543ae27eeefea630e8050 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Sun, 27 Jun 2021 17:50:41 +0200 Subject: [PATCH] Use Autocomplete on TagInput again --- ts/editor/TagEditor.svelte | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/ts/editor/TagEditor.svelte b/ts/editor/TagEditor.svelte index e661108f8..c49a812c4 100644 --- a/ts/editor/TagEditor.svelte +++ b/ts/editor/TagEditor.svelte @@ -40,7 +40,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html } function decideNextActive() { - console.log("dna", active, activeAfterBlur, JSON.stringify(tags)); + console.log("dna", active, activeAfterBlur); active = activeAfterBlur; activeAfterBlur = null; } @@ -218,14 +218,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html id={tag.id} bind:name={tag.name} bind:input - on:focus={() => - console.log( - "focused", - tag, - tag.name, - JSON.stringify(tags) - )} - on:blur={decideNextActive} + on:keydown={updateAutocomplete} + on:blur={() => { + destroyAutocomplete(); + decideNextActive(); + }} on:tagsplit={({ detail }) => splitTag(tag, index, detail.start, detail.end)} on:tagadd={() => insertTag(tag, index)}