@@ -22,10 +22,10 @@ import useKeyboard from './useKeyboard';
2222export type RawOptionListProps = Pick <
2323 ReturnType < typeof useBaseProps > ,
2424 'prefixCls' | 'multiple' | 'searchValue' | 'toggleOpen' | 'notFoundContent' | 'direction' | 'open'
25- > & { defaultActiveValueCells ?: React . Key [ ] ; } ;
25+ > & { defaultActiveKey ?: React . Key [ ] ; } ;
2626
2727const RawOptionList = React . forwardRef < RefOptionListProps , RawOptionListProps > ( ( props , ref ) => {
28- const { prefixCls, multiple, searchValue, toggleOpen, notFoundContent, direction, open, defaultActiveValueCells } = props ;
28+ const { prefixCls, multiple, searchValue, toggleOpen, notFoundContent, direction, open, defaultActiveKey } = props ;
2929
3030 const containerRef = React . useRef < HTMLDivElement > ( null ) ;
3131 const rtl = direction === 'rtl' ;
@@ -89,7 +89,7 @@ const RawOptionList = React.forwardRef<RefOptionListProps, RawOptionListProps>((
8989 const halfCheckedSet = React . useMemo ( ( ) => new Set ( toPathKeys ( halfValues ) ) , [ halfValues ] ) ;
9090
9191 // ====================== Accessibility =======================
92- const [ activeValueCells , setActiveValueCells ] = useActive ( multiple , open ) ;
92+ const [ activeValueCells , setActiveValueCells ] = useActive ( multiple , open , defaultActiveKey ) ;
9393
9494 // =========================== Path ===========================
9595 const onPathOpen = ( nextValueCells : React . Key [ ] ) => {
@@ -99,12 +99,6 @@ const RawOptionList = React.forwardRef<RefOptionListProps, RawOptionListProps>((
9999 internalLoadData ( nextValueCells ) ;
100100 } ;
101101
102- React . useEffect ( ( ) => {
103- if ( defaultActiveValueCells && defaultActiveValueCells ?. length > 0 ) {
104- setActiveValueCells ( defaultActiveValueCells )
105- }
106- } , [ defaultActiveValueCells ] ) ;
107-
108102 const isSelectable = ( option : DefaultOptionType ) => {
109103 const { disabled } = option ;
110104
0 commit comments