Skip to content

Commit ef7daca

Browse files
committed
Enhance Combobox to disable when no options are available
- Updated the Combobox component to disable the select input when there are no options and not fetching options, improving user experience.
1 parent 04fed23 commit ef7daca

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/components/combobox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default function Combobox({ options, setOptions, selectedValue, onSelecte
6060
}, [open])
6161

6262
return (
63-
<Select open={open} onOpenChange={setOpen} value={isFetchingOptions ? "Fetching options..." : options.length !== 0 ? selectedValue : "No options found"} onValueChange={onSelectedValue}>
63+
<Select open={open} onOpenChange={setOpen} disabled={options.length === 0 && !isFetchingOptions} value={isFetchingOptions ? "Fetching options..." : options.length !== 0 ? selectedValue : "No options found"} onValueChange={onSelectedValue}>
6464
<SelectTrigger className="z-10 md:z-0 rounded-md border border-gray-400 md:border-gray-100 focus:ring-0 focus:ring-offset-0">
6565
<SelectValue placeholder="Select a repo" />
6666
</SelectTrigger>

0 commit comments

Comments
 (0)