11import 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' ;
33import { BaseSelect } from 'rc-select' ;
4- import type { DisplayValueType , Placement } from 'rc-select/lib/BaseSelect' ;
4+ import type { DisplayValueType , Placement } from 'rc-select/lib/BaseSelect' ;
55import useId from 'rc-select/lib/hooks/useId' ;
66import { conductCheck } from 'rc-tree/lib/utils/conductUtil' ;
77import useMergedState from 'rc-util/lib/hooks/useMergedState' ;
@@ -14,9 +14,9 @@ import useRefFunc from './hooks/useRefFunc';
1414import useSearchConfig from './hooks/useSearchConfig' ;
1515import useSearchOptions from './hooks/useSearchOptions' ;
1616import 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' ;
2020
2121export interface ShowSearchType < OptionType extends BaseOptionType = DefaultOptionType > {
2222 filter ?: ( inputValue : string , options : OptionType [ ] , fieldNames : FieldNames ) => boolean ;
@@ -199,6 +199,7 @@ const Cascader = React.forwardRef<CascaderRef, InternalCascaderProps>((props, re
199199
200200 popupClassName,
201201 dropdownClassName,
202+ dropdownStyle,
202203 dropdownMenuColumnStyle,
203204
204205 popupPlacement,
@@ -473,14 +474,16 @@ const Cascader = React.forwardRef<CascaderRef, InternalCascaderProps>((props, re
473474 // ==============================================================
474475 const emptyOptions = ! ( mergedSearchValue ? searchOptions : mergedOptions ) . length ;
475476
476- const dropdownStyle : React . CSSProperties =
477+ const mergedDropdownStyle : React . CSSProperties =
477478 // 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+ }
482484 : {
483485 minWidth : 'auto' ,
486+ ...dropdownStyle ,
484487 } ;
485488
486489 return (
@@ -492,7 +495,7 @@ const Cascader = React.forwardRef<CascaderRef, InternalCascaderProps>((props, re
492495 id = { mergedId }
493496 prefixCls = { prefixCls }
494497 dropdownMatchSelectWidth = { dropdownMatchSelectWidth }
495- dropdownStyle = { dropdownStyle }
498+ dropdownStyle = { mergedDropdownStyle }
496499 // Value
497500 displayValues = { displayValues }
498501 onDisplayValuesChange = { onDisplayValuesChange }
0 commit comments