1
1
import type { BuildInPlacements } from '@rc-component/trigger/lib/interface' ;
2
- import type { BaseSelectProps , BaseSelectPropsWithoutPrivate , BaseSelectRef } from 'rc-select' ;
2
+ import type { BaseSelectProps , BaseSelectPropsWithoutPrivate , BaseSelectRef } from 'rc-select' ;
3
3
import { BaseSelect } from 'rc-select' ;
4
- import type { DisplayValueType , Placement } from 'rc-select/lib/BaseSelect' ;
4
+ import type { DisplayValueType , Placement } from 'rc-select/lib/BaseSelect' ;
5
5
import useId from 'rc-select/lib/hooks/useId' ;
6
6
import { conductCheck } from 'rc-tree/lib/utils/conductUtil' ;
7
7
import useMergedState from 'rc-util/lib/hooks/useMergedState' ;
@@ -14,9 +14,9 @@ import useRefFunc from './hooks/useRefFunc';
14
14
import useSearchConfig from './hooks/useSearchConfig' ;
15
15
import useSearchOptions from './hooks/useSearchOptions' ;
16
16
import OptionList from './OptionList' ;
17
- import { fillFieldNames , SHOW_CHILD , SHOW_PARENT , toPathKey , toPathKeys } from './utils/commonUtil' ;
18
- import { formatStrategyValues , toPathOptions } from './utils/treeUtil' ;
19
- import warningProps , { warningNullOptions } from './utils/warningPropsUtil' ;
17
+ import { fillFieldNames , SHOW_CHILD , SHOW_PARENT , toPathKey , toPathKeys } from './utils/commonUtil' ;
18
+ import { formatStrategyValues , toPathOptions } from './utils/treeUtil' ;
19
+ import warningProps , { warningNullOptions } from './utils/warningPropsUtil' ;
20
20
21
21
export interface ShowSearchType < OptionType extends BaseOptionType = DefaultOptionType > {
22
22
filter ?: ( inputValue : string , options : OptionType [ ] , fieldNames : FieldNames ) => boolean ;
@@ -199,6 +199,7 @@ const Cascader = React.forwardRef<CascaderRef, InternalCascaderProps>((props, re
199
199
200
200
popupClassName,
201
201
dropdownClassName,
202
+ dropdownStyle,
202
203
dropdownMenuColumnStyle,
203
204
204
205
popupPlacement,
@@ -473,14 +474,16 @@ const Cascader = React.forwardRef<CascaderRef, InternalCascaderProps>((props, re
473
474
// ==============================================================
474
475
const emptyOptions = ! ( mergedSearchValue ? searchOptions : mergedOptions ) . length ;
475
476
476
- const dropdownStyle : React . CSSProperties =
477
+ const mergedDropdownStyle : React . CSSProperties =
477
478
// Search to match width
478
- ( mergedSearchValue && searchConfig . matchInputWidth ) ||
479
- // Empty keep the width
480
- emptyOptions
481
- ? { }
479
+ dropdownStyle ?? ( mergedSearchValue && searchConfig . matchInputWidth ) ?? emptyOptions
480
+ ? // Empty keep the width
481
+ {
482
+ ...dropdownStyle ,
483
+ }
482
484
: {
483
485
minWidth : 'auto' ,
486
+ ...dropdownStyle ,
484
487
} ;
485
488
486
489
return (
@@ -492,7 +495,7 @@ const Cascader = React.forwardRef<CascaderRef, InternalCascaderProps>((props, re
492
495
id = { mergedId }
493
496
prefixCls = { prefixCls }
494
497
dropdownMatchSelectWidth = { dropdownMatchSelectWidth }
495
- dropdownStyle = { dropdownStyle }
498
+ dropdownStyle = { mergedDropdownStyle }
496
499
// Value
497
500
displayValues = { displayValues }
498
501
onDisplayValuesChange = { onDisplayValuesChange }
0 commit comments