@@ -292,47 +292,49 @@ const Combobox = React.forwardRef<ComboboxInputElement, ComboboxProps>(
292292 </ Trigger >
293293 < ComboboxPrimitive . Portal >
294294 < Content sideOffset = { 4 } >
295- < ComboboxPrimitive . Viewport ref = { viewportRef } >
296- < ScrollAreaCombobox >
297- { shouldVirtualizeOptions ? (
298- < VirtualizedList itemCount = { childrenCount } > { children } </ VirtualizedList >
299- ) : (
300- children
301- ) }
302- { creatable !== true && ! loading ? (
303- < ComboboxPrimitive . NoValueFound asChild >
304- < OptionBox $hasHover = { false } >
305- < Typography > { noOptionsMessage ( internalTextValue ?? '' ) } </ Typography >
306- </ OptionBox >
307- </ ComboboxPrimitive . NoValueFound >
308- ) : null }
309- { loading ? (
310- < Flex justifyContent = "center" alignItems = "center" paddingTop = { 2 } paddingBottom = { 2 } >
311- < Loader small > { loadingMessage } </ Loader >
312- </ Flex >
313- ) : null }
314- < Box id = { intersectionId } width = "100%" height = "1px" />
315- </ ScrollAreaCombobox >
316- { creatable ? (
317- < ComboboxCreateItem
318- onPointerUp = { handleCreateItemClick }
319- onClick = { handleCreateItemClick }
320- disabled = { creatableDisabled }
321- asChild
322- >
323- < OptionBox >
324- < Flex gap = { 2 } >
325- { creatableStartIcon && (
326- < Box tag = "span" aria-hidden display = { 'inline-flex' } >
327- { creatableStartIcon }
328- </ Box >
329- ) }
330- < Typography > { createMessage ( internalTextValue ?? '' ) } </ Typography >
295+ < ScrollArea >
296+ < ComboboxPrimitive . Viewport ref = { viewportRef } >
297+ < Box padding = { 1 } >
298+ { shouldVirtualizeOptions ? (
299+ < VirtualizedList itemCount = { childrenCount } > { children } </ VirtualizedList >
300+ ) : (
301+ children
302+ ) }
303+ { creatable !== true && ! loading ? (
304+ < ComboboxPrimitive . NoValueFound asChild >
305+ < OptionBox $hasHover = { false } >
306+ < Typography > { noOptionsMessage ( internalTextValue ?? '' ) } </ Typography >
307+ </ OptionBox >
308+ </ ComboboxPrimitive . NoValueFound >
309+ ) : null }
310+ { loading ? (
311+ < Flex justifyContent = "center" alignItems = "center" paddingTop = { 2 } paddingBottom = { 2 } >
312+ < Loader small > { loadingMessage } </ Loader >
331313 </ Flex >
332- </ OptionBox >
333- </ ComboboxCreateItem >
334- ) : null }
335- </ ComboboxPrimitive . Viewport >
314+ ) : null }
315+ < Box id = { intersectionId } width = "100%" height = "1px" />
316+ </ Box >
317+ </ ComboboxPrimitive . Viewport >
318+ </ ScrollArea >
319+ { creatable ? (
320+ < ComboboxCreateItem
321+ onPointerUp = { handleCreateItemClick }
322+ onClick = { handleCreateItemClick }
323+ disabled = { creatableDisabled }
324+ asChild
325+ >
326+ < OptionBox >
327+ < Flex gap = { 2 } >
328+ { creatableStartIcon && (
329+ < Box tag = "span" aria-hidden display = { 'inline-flex' } >
330+ { creatableStartIcon }
331+ </ Box >
332+ ) }
333+ < Typography > { createMessage ( internalTextValue ?? '' ) } </ Typography >
334+ </ Flex >
335+ </ OptionBox >
336+ </ ComboboxCreateItem >
337+ ) : null }
336338 </ Content >
337339 </ ComboboxPrimitive . Portal >
338340 </ ComboboxPrimitive . Root >
@@ -489,10 +491,6 @@ const ComboboxCreateItem = styled(ComboboxPrimitive.CreateItem)`
489491 }
490492` ;
491493
492- const ScrollAreaCombobox = styled ( ScrollArea ) `
493- padding: ${ ( { theme } ) => theme . spaces [ 1 ] } ;
494- ` ;
495-
496494/* -------------------------------------------------------------------------------------------------
497495 * ComboboxOption
498496 * -----------------------------------------------------------------------------------------------*/
0 commit comments