@@ -6,7 +6,6 @@ import RuiIcon from '@/components/icons/Icon.vue';
6
6
import RuiChip from ' @/components/chips/Chip.vue' ;
7
7
import RuiMenu , { type MenuProps } from ' @/components/overlays/menu/Menu.vue' ;
8
8
import RuiProgress from ' @/components/progress/Progress.vue' ;
9
- import type { Ref } from ' vue' ;
10
9
11
10
export type T = any ;
12
11
@@ -521,6 +520,13 @@ function arrowClicked(event: any) {
521
520
}
522
521
}
523
522
523
+ const renderedOptions = ref ([]);
524
+
525
+ const menuMinHeight: ComputedRef <number > = computed (() => {
526
+ const renderedOptionsData = get (renderedOptions ).slice (0 , 5 );
527
+ return renderedOptionsData .reduce ((currentValue , item : typeof RuiButton ) => currentValue + item .$el .offsetHeight , 0 );
528
+ });
529
+
524
530
defineExpose ({
525
531
focus: setInputFocus ,
526
532
setSelectionRange ,
@@ -711,7 +717,7 @@ defineExpose({
711
717
<div
712
718
v-if =" optionsWithSelectedHidden.length > 0"
713
719
:class =" [css.menu, menuClass]"
714
- :style =" { width: `${width}px`, minWidth: menuWidth }"
720
+ :style =" { width: `${width}px`, minWidth: menuWidth, minHeight: `${menuMinHeight}px` }"
715
721
v-bind =" virtualContainerProps"
716
722
@scroll =" containerProps.onScroll"
717
723
@keydown.up.prevent =" moveHighlight(true)"
@@ -723,7 +729,8 @@ defineExpose({
723
729
>
724
730
<RuiButton
725
731
v-for =" ({ item, index }) in renderedData"
726
- :key =" index"
732
+ ref =" renderedOptions"
733
+ :key =" getIdentifier(item)"
727
734
:active =" isActiveItem(item)"
728
735
:size =" dense ? 'sm' : undefined"
729
736
:value =" getIdentifier(item)"
0 commit comments