From 8b996c6e25df060f1dea33768c58dda54f443bd3 Mon Sep 17 00:00:00 2001 From: Denozordec Date: Fri, 10 Apr 2026 15:22:19 +0700 Subject: [PATCH] Refactor select component to streamline value handling - Removed the `onValueChange` prop from the select component to simplify its interface. - Updated the alias filter select component to ensure the selected value defaults to "all" if not present in available aliases, enhancing user experience. --- web/src/lib/components/alias-filter-select.svelte | 1 - web/src/lib/components/ui/select/select.svelte | 15 ++------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/web/src/lib/components/alias-filter-select.svelte b/web/src/lib/components/alias-filter-select.svelte index 960134b..4de2926 100644 --- a/web/src/lib/components/alias-filter-select.svelte +++ b/web/src/lib/components/alias-filter-select.svelte @@ -15,7 +15,6 @@ $effect(() => { if (!value) value = "all"; - if (value !== "all" && !availableAliases.includes(value)) value = "all"; }); diff --git a/web/src/lib/components/ui/select/select.svelte b/web/src/lib/components/ui/select/select.svelte index 5eba66b..05eb663 100644 --- a/web/src/lib/components/ui/select/select.svelte +++ b/web/src/lib/components/ui/select/select.svelte @@ -4,19 +4,8 @@ let { open = $bindable(false), value = $bindable(), - onValueChange, ...restProps - }: SelectPrimitive.RootProps & { - onValueChange?: (next: string | string[]) => void; - } = $props(); + }: SelectPrimitive.RootProps = $props(); - { - value = next as typeof value; - onValueChange?.(next as string | string[]); - }} - {...restProps} -/> +