Make Autocomplete dismount along with TagInput on blur

This commit is contained in:
Henrik Giesel 2021-06-28 02:08:30 +02:00
parent b4e84e8043
commit ba64f50593

View file

@ -219,6 +219,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<ButtonToolbar class="dropup d-flex flex-wrap align-items-center" {size}> <ButtonToolbar class="dropup d-flex flex-wrap align-items-center" {size}>
<AddTagBadge on:click={appendEmptyTag} /> <AddTagBadge on:click={appendEmptyTag} />
{#each tags as tag, index (tag.id)}
{#if index === active}
<TagAutocomplete <TagAutocomplete
class="d-flex flex-column-reverse" class="d-flex flex-column-reverse"
{suggestions} {suggestions}
@ -227,8 +229,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
let:updateAutocomplete let:updateAutocomplete
let:destroyAutocomplete let:destroyAutocomplete
> >
{#each tags as tag, index (tag.id)}
{#if index === active}
<TagInput <TagInput
id={tag.id} id={tag.id}
bind:name={activeName} bind:name={activeName}
@ -252,6 +252,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
tag.name = activeName; tag.name = activeName;
}} }}
/> />
</TagAutocomplete>
{:else} {:else}
<Tag <Tag
name={tag.name} name={tag.name}
@ -266,7 +267,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
class="tag-spacer flex-grow-1 align-self-stretch" class="tag-spacer flex-grow-1 align-self-stretch"
on:click={appendEmptyTag} on:click={appendEmptyTag}
/> />
</TagAutocomplete>
<div> <div>
a, aab, an, ac: {active} a, aab, an, ac: {active}