fix: custom labels causing missing select

This commit is contained in:
James Xylight committed 2025-08-30 14:45:06 -07:00
1 parent e1cfff376e
commit d93d29a8b1
6 files changed
+19 -15

No files matched your search

+7 -4
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import type { Snippet } from 'svelte'
import type { ClassValue, HTMLAttributes } from 'svelte/elements'
interface Props extends HTMLAttributes<HTMLSpanElement> {
@@ -8,13 +9,14 @@
*/
text?: string | undefined
class?: ClassValue
children?: import('svelte').Snippet
customText?: Snippet
}
let {
for: forID = undefined,
text = undefined,
class: clazz = '',
customText,
children,
...rest
}: Props = $props()
@@ -26,8 +28,9 @@
class={['text-sm text-slate-800 dark:text-zinc-200 font-medium', clazz]}
>
{#if text}
{text}
{:else if children}
{@render children?.()}
<div class="inline-block">{text}</div>
{:else if customText}
{@render customText?.()}
{/if}
{@render children?.()}
</label>
+1 -2
View File
@@ -93,8 +93,7 @@
</script>
{#snippet selectTarget(attachment: Attachment)}
<Label text={label} class={['space-y-1 relative', clazz, baseClass]}>
{@render customLabel?.()}
<Label text={label} customText={customLabel} class={['space-y-1 relative', clazz, baseClass]}>
<div class="relative" role="presentation">
<select
{@attach attachment}