UX(taghint): don't show deleted tags if they are not present on the object in the first place

This commit is contained in:
Pieter Vander Vennet 2025-06-25 15:43:00 +02:00
parent 87358505e9
commit 73d40206b4

View file

@ -10,19 +10,19 @@
* Depending on the options, it'll link through to the wiki or might be completely hidden * Depending on the options, it'll link through to the wiki or might be completely hidden
*/ */
export let tags: TagsFilter[] export let tags: TagsFilter[]
export let currentProperties: Record<string, string> = {} export let currentProperties: Record<string, string> = undefined
</script> </script>
{#if tags?.length > 0} {#if tags?.length > 0}
<div class="flex flex-wrap gap-x-4"> <div class="flex flex-wrap gap-x-4">
{#each tags as tag} {#each tags as tag}
<div class="break-words" style="word-break: break-word"> <div class="break-words" style="word-break: break-word">
{#if tag["value"] === ""} {#if tag["value"] === "" && currentProperties?.[tag["key"]]}
<del> <del>
{tag["key"]} {tag["key"]}
</del> </del>
{:else} {:else}
<FromHtml src={tag.asHumanString(true, false, currentProperties)} /> <FromHtml src={tag.asHumanString(true, false, currentProperties ?? {})} />
{/if} {/if}
</div> </div>
{/each} {/each}