@@ -194,6 +194,7 @@ import { useFormField } from '../composables/useFormField'
194194import { useLocale } from ' ../composables/useLocale'
195195import { usePortal } from ' ../composables/usePortal'
196196import { compare , get , getDisplayValue , isArrayOfArray } from ' ../utils'
197+ import { getEstimateSize } from ' ../utils/virtualizer'
197198import { tv } from ' ../utils/tv'
198199import UIcon from ' ./Icon.vue'
199200import UAvatar from ' ./Avatar.vue'
@@ -225,15 +226,13 @@ const rootProps = useForwardPropsEmits(reactivePick(props, 'modelValue', 'defaul
225226const portalProps = usePortal (toRef (() => props .portal ))
226227const contentProps = toRef (() => defu (props .content , { side: ' bottom' , sideOffset: 8 , collisionPadding: 8 , position: ' popper' }) as ComboboxContentProps )
227228const arrowProps = toRef (() => props .arrow as ComboboxArrowProps )
228- const virtualizerProps = toRef (() => !! props .virtualize && defu (typeof props .virtualize === ' boolean' ? {} : props .virtualize , {
229- estimateSize : ({
230- xs: 24 ,
231- sm: 28 ,
232- md: 32 ,
233- lg: 36 ,
234- xl: 40
235- })[props .size || ' md' ]
236- }))
229+ const virtualizerProps = toRef (() => {
230+ if (! props .virtualize ) return false
231+
232+ return defu (typeof props .virtualize === ' boolean' ? {} : props .virtualize , {
233+ estimateSize: getEstimateSize (items .value , props .size || ' md' , props .descriptionKey as string )
234+ })
235+ })
237236const searchInputProps = toRef (() => defu (props .searchInput , { placeholder: t (' selectMenu.search' ), variant: ' none' }) as InputProps )
238237
239238const { emitFormBlur, emitFormFocus, emitFormInput, emitFormChange, size : formGroupSize, color, id, name, highlight, disabled, ariaAttrs } = useFormField <InputProps >(props )
0 commit comments