Use Autocomplete on TagInput again

This commit is contained in:
Henrik Giesel 2021-06-27 17:50:41 +02:00
parent cda5e44786
commit 68bbc8d25d

View file

@ -40,7 +40,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
} }
function decideNextActive() { function decideNextActive() {
console.log("dna", active, activeAfterBlur, JSON.stringify(tags)); console.log("dna", active, activeAfterBlur);
active = activeAfterBlur; active = activeAfterBlur;
activeAfterBlur = null; activeAfterBlur = null;
} }
@ -218,14 +218,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
id={tag.id} id={tag.id}
bind:name={tag.name} bind:name={tag.name}
bind:input bind:input
on:focus={() => on:keydown={updateAutocomplete}
console.log( on:blur={() => {
"focused", destroyAutocomplete();
tag, decideNextActive();
tag.name, }}
JSON.stringify(tags)
)}
on:blur={decideNextActive}
on:tagsplit={({ detail }) => on:tagsplit={({ detail }) =>
splitTag(tag, index, detail.start, detail.end)} splitTag(tag, index, detail.start, detail.end)}
on:tagadd={() => insertTag(tag, index)} on:tagadd={() => insertTag(tag, index)}