From f1c74b74977a9f2310b43f29c407add165af42f4 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Mon, 22 Dec 2025 00:36:27 -0800 Subject: [PATCH] fix select dropdown color and mixed-type value handling --- src/lib/components/ui/Select.svelte | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/components/ui/Select.svelte b/src/lib/components/ui/Select.svelte index 1143c2d0..70c2c10e 100644 --- a/src/lib/components/ui/Select.svelte +++ b/src/lib/components/ui/Select.svelte @@ -88,8 +88,9 @@ function handleValueChange(newValue: string | undefined) { if (newValue !== undefined) { - // Convert string back to original type - const typedValue = (typeof options[0]?.value === 'number' ? Number(newValue) : newValue) as T + // Find the option by its stringified value to get the original type + const matchingOption = options.find((opt) => String(opt.value) === newValue) + const typedValue = (matchingOption !== undefined ? matchingOption.value : newValue) as T value = typedValue if (onValueChange) { onValueChange(typedValue) @@ -351,7 +352,7 @@ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - color: var(--text-tertiary); + color: var(--text-secondary); } .image {