File tree Expand file tree Collapse file tree 1 file changed +16
-13
lines changed
Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import {
2222 PopoverContent ,
2323 PopoverTrigger
2424} from "@/components/ui/popover"
25+ import { ScrollArea } from "@/components/ui/scroll-area"
2526import { cn } from "@/lib/utils"
2627
2728export type Option = {
@@ -139,19 +140,21 @@ export const MultiSelect = ({
139140 < CommandInput placeholder = { placeholder } />
140141 </ div >
141142 < CommandGroup >
142- { options . map ( ( option ) => (
143- < CommandItem
144- key = { option . value }
145- onSelect = { ( ) => toggleOption ( option . value ) } >
146- < div className = "flex items-center gap-2" >
147- { option . icon && < option . icon className = "h-4 w-4" /> }
148- < span > { option . label } </ span >
149- </ div >
150- { selectedValues . includes ( option . value ) && (
151- < Check className = "ml-auto h-4 w-4" />
152- ) }
153- </ CommandItem >
154- ) ) }
143+ < ScrollArea className = "max-h-[300px] overflow-y-scroll" >
144+ { options . map ( ( option ) => (
145+ < CommandItem
146+ key = { option . value }
147+ onSelect = { ( ) => toggleOption ( option . value ) } >
148+ < div className = "flex items-center gap-2" >
149+ { option . icon && < option . icon className = "h-4 w-4" /> }
150+ < span > { option . label } </ span >
151+ </ div >
152+ { selectedValues . includes ( option . value ) && (
153+ < Check className = "ml-auto h-4 w-4" />
154+ ) }
155+ </ CommandItem >
156+ ) ) }
157+ </ ScrollArea >
155158 </ CommandGroup >
156159 </ Command >
157160 </ PopoverContent >
You can’t perform that action at this time.
0 commit comments