From 201773e7c6388f73f851938d2770f5de6f6e4321 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Thu, 1 Jul 2021 21:21:19 +0200 Subject: [PATCH] Fix autocomplete dropdown + find a different solution for making tags and tag inputs same size --- ts/editor/Tag.svelte | 1 + ts/editor/TagEditor.svelte | 39 ++++++++++-------- ts/editor/TagInput.svelte | 81 ++++++++++++++++---------------------- 3 files changed, 58 insertions(+), 63 deletions(-) diff --git a/ts/editor/Tag.svelte b/ts/editor/Tag.svelte index d220310b7..53008cc57 100644 --- a/ts/editor/Tag.svelte +++ b/ts/editor/Tag.svelte @@ -133,6 +133,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html $with-disabled: false, $with-hover: false ); + @include button.btn-night( $with-active: false, $with-disabled: false, diff --git a/ts/editor/TagEditor.svelte b/ts/editor/TagEditor.svelte index 9d477421a..adb5557d2 100644 --- a/ts/editor/TagEditor.svelte +++ b/ts/editor/TagEditor.svelte @@ -374,7 +374,23 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html {#each tags as tag, index (tag.id)} -
+
+ { + active = index; + deselect(); + }} + on:tagselect={() => select(index)} + on:tagrange={() => selectRange(index)} + on:tagdelete={() => { + deleteTagAt(index); + saveTags(); + }} + /> + {#if index === active} { @@ -414,22 +431,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html }} /> - {:else} - { - active = index; - deselect(); - }} - on:tagselect={() => select(index)} - on:tagrange={() => selectRange(index)} - on:tagdelete={() => { - deleteTagAt(index); - saveTags(); - }} - /> {/if}
{/each} @@ -445,4 +446,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html .tag-spacer { cursor: text; } + + .hide-tag :global(.tag) { + opacity: 0; + } diff --git a/ts/editor/TagInput.svelte b/ts/editor/TagInput.svelte index afc3e096a..9c6344126 100644 --- a/ts/editor/TagInput.svelte +++ b/ts/editor/TagInput.svelte @@ -3,10 +3,13 @@ Copyright: Ankitects Pty Ltd and contributors License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html --> - +