fix: collapsible space toggle issue

This commit is contained in:
Timothy J. Baek
2024-10-16 22:36:44 -07:00
parent 7b97d7a718
commit 29c39d44e1
4 changed files with 76 additions and 17 deletions

View File

@@ -18,7 +18,9 @@
<div class={className}>
{#if title !== null}
<button class={buttonClassName} on:click={() => (open = !open)}>
<!-- svelte-ignore a11y-no-static-element-interactions -->
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div class={buttonClassName} on:pointerup={() => (open = !open)}>
<div class=" w-fit font-medium transition flex items-center justify-between gap-2">
<div>
{title}
@@ -32,15 +34,17 @@
{/if}
</div>
</div>
</button>
</div>
{:else}
<button class={buttonClassName} on:click={() => (open = !open)}>
<!-- svelte-ignore a11y-no-static-element-interactions -->
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div class={buttonClassName} on:pointerup={() => (open = !open)}>
<div
class="flex items-center gap-2 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 transition"
>
<slot />
</div>
</button>
</div>
{/if}
{#if open}