Skip to content

Commit 42c517e

Browse files
committed
chore: menu with modification from select picker
1 parent da93ad7 commit 42c517e

File tree

1 file changed

+15
-6
lines changed
  • src/Shared/Components/SelectPicker

1 file changed

+15
-6
lines changed

src/Shared/Components/SelectPicker/utils.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,24 @@ import { SelectPickerOptionType, SelectPickerProps, SelectPickerVariantType } fr
2121

2222
const getMenuWidthFromSize = <OptionValue, IsMulti extends boolean>(
2323
menuSize: SelectPickerProps<OptionValue, IsMulti>['menuSize'],
24-
): string => {
24+
): { width: string; minWidth: string } => {
2525
switch (menuSize) {
2626
case ComponentSizeType.medium:
27-
return '125%'
27+
return {
28+
width: '125%',
29+
minWidth: '250px',
30+
}
2831
case ComponentSizeType.large:
29-
return '150%'
32+
return {
33+
width: '150%',
34+
minWidth: '300px',
35+
}
3036
case ComponentSizeType.small:
3137
default:
32-
return '100%'
38+
return {
39+
width: '100%',
40+
minWidth: '200px',
41+
}
3342
}
3443
}
3544

@@ -95,8 +104,8 @@ export const getCommonSelectStyle = <OptionValue, IsMulti extends boolean>({
95104
backgroundColor: 'var(--N0)',
96105
border: '1px solid var(--N200)',
97106
boxShadow: '0px 2px 4px 0px rgba(0, 0, 0, 0.20)',
98-
width: getMenuWidthFromSize(menuSize),
99-
minWidth: '200px',
107+
width: getMenuWidthFromSize(menuSize).width,
108+
minWidth: getMenuWidthFromSize(menuSize).minWidth,
100109
zIndex: 'var(--select-picker-menu-index)',
101110
...(shouldMenuAlignRight && {
102111
right: 0,

0 commit comments

Comments
 (0)