Open Gaurav-r-a-j opened 3 months ago
Wrap in CommandList
.
import { CommandList } from '@/components/ui/command';
...
<CommandList>
<CommandEmpty>No language found.</CommandEmpty>
<CommandGroup>
{languages.map((language) => (
<CommandItem
value={language.label}
key={language.value}
onSelect={() => {
form.setValue('language', language.value);
}}
>
<Check
className={cn(
'mr-2 h-4 w-4',
language.value === field.value
? 'opacity-100'
: 'opacity-0',
)}
/>
{language.label}
</CommandItem>
))}
</CommandGroup>
</CommandList>
...
the solution @patelvivekdev offered worked for my implementation, and correctly shows the list of command items.
Describe the bug
When Navigating through the combobox components ' the last example which show a form for selecting language when you click on language the website crashes and show this error "Application error: a client-side exception has occurred (see the browser console for more information)."
Affected component/components
Combobox
How to reproduce
Codesandbox/StackBlitz link
https://ui.shadcn.com/docs/components/combobox
Logs
System Info
Before submitting