Commit 7a0a723 1 parent 69437d7 commit 7a0a723 Copy full SHA for 7a0a723
File tree 1 file changed +9
-0
lines changed
packages/components/src/components/form/Select
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ type WrapperProps = TransientProps<
116
116
$isWithPlaceholder : boolean ;
117
117
$elevation : Elevation ;
118
118
$isLoading ?: boolean ;
119
+ $menuFitContent ?: boolean ;
119
120
} ;
120
121
121
122
const SelectWrapper = styled . div < WrapperProps > `
@@ -230,6 +231,11 @@ const SelectWrapper = styled.div<WrapperProps>`
230
231
${ menuStyle }
231
232
border: none;
232
233
z-index: ${ zIndices . base } ;
234
+ ${ ( { $menuFitContent } ) =>
235
+ $menuFitContent &&
236
+ css `
237
+ width: fit-content;
238
+ ` }
233
239
}
234
240
235
241
${ ( { $isDisabled } ) =>
@@ -276,6 +282,7 @@ export type SelectProps = KeyPressScrollProps &
276
282
label ?: ReactNode ;
277
283
size ?: InputSize ;
278
284
minValueWidth ?: string ;
285
+ menuFitContent ?: boolean ;
279
286
isMenuOpen ?: boolean ;
280
287
isLoading ?: boolean ;
281
288
onChange ?: ( value : Option , ref ?: SelectInstance < Option , boolean > | null ) => void ;
@@ -289,6 +296,7 @@ export const Select = ({
289
296
useKeyPressScroll,
290
297
isSearchable = false ,
291
298
minValueWidth = 'initial' ,
299
+ menuFitContent,
292
300
isMenuOpen,
293
301
components,
294
302
onChange,
@@ -348,6 +356,7 @@ export const Select = ({
348
356
$isSearchable = { isSearchable }
349
357
$size = { size }
350
358
$minValueWidth = { minValueWidth }
359
+ $menuFitContent = { menuFitContent }
351
360
$isDisabled = { isDisabled }
352
361
$isLoading = { isLoading }
353
362
$isMenuOpen = { isMenuOpen }
You can’t perform that action at this time.
0 commit comments