Fix dropdown for HF models
Browse files
src/components/ui/combobox.tsx
CHANGED
|
@@ -53,6 +53,7 @@ export function Combobox({
|
|
| 53 |
}, [disableLocalFilter, options, search]);
|
| 54 |
|
| 55 |
const selectedOption = options.find((opt) => opt.id === value);
|
|
|
|
| 56 |
|
| 57 |
return (
|
| 58 |
<Popover open={open} onOpenChange={setOpen}>
|
|
@@ -64,7 +65,7 @@ export function Combobox({
|
|
| 64 |
className="w-full justify-between font-normal"
|
| 65 |
>
|
| 66 |
<span className="truncate">
|
| 67 |
-
{
|
| 68 |
</span>
|
| 69 |
<ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" />
|
| 70 |
</Button>
|
|
|
|
| 53 |
}, [disableLocalFilter, options, search]);
|
| 54 |
|
| 55 |
const selectedOption = options.find((opt) => opt.id === value);
|
| 56 |
+
const selectedLabel = selectedOption?.name ?? (value ? value : placeholder);
|
| 57 |
|
| 58 |
return (
|
| 59 |
<Popover open={open} onOpenChange={setOpen}>
|
|
|
|
| 65 |
className="w-full justify-between font-normal"
|
| 66 |
>
|
| 67 |
<span className="truncate">
|
| 68 |
+
{selectedLabel}
|
| 69 |
</span>
|
| 70 |
<ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" />
|
| 71 |
</Button>
|