@@ -29,7 +29,7 @@ export type RawOptionListProps = Pick<
2929 | 'direction'
3030 | 'open'
3131 | 'disabled'
32- > & { defaultActiveValueCells ?: React . Key [ ] ; } ;
32+ > & { defaultActiveKey ?: React . Key [ ] ; } ;
3333
3434const RawOptionList = React . forwardRef < RefOptionListProps , RawOptionListProps > ( ( props , ref ) => {
3535 const {
@@ -41,7 +41,7 @@ const RawOptionList = React.forwardRef<RefOptionListProps, RawOptionListProps>((
4141 direction,
4242 open,
4343 disabled,
44- defaultActiveValueCells ,
44+ defaultActiveKey ,
4545 } = props ;
4646
4747 const containerRef = React . useRef < HTMLDivElement > ( null ) ;
@@ -106,7 +106,7 @@ const RawOptionList = React.forwardRef<RefOptionListProps, RawOptionListProps>((
106106 const halfCheckedSet = React . useMemo ( ( ) => new Set ( toPathKeys ( halfValues ) ) , [ halfValues ] ) ;
107107
108108 // ====================== Accessibility =======================
109- const [ activeValueCells , setActiveValueCells ] = useActive ( multiple , open ) ;
109+ const [ activeValueCells , setActiveValueCells ] = useActive ( multiple , open , defaultActiveKey ) ;
110110
111111 // =========================== Path ===========================
112112 const onPathOpen = ( nextValueCells : React . Key [ ] ) => {
@@ -116,12 +116,6 @@ const RawOptionList = React.forwardRef<RefOptionListProps, RawOptionListProps>((
116116 internalLoadData ( nextValueCells ) ;
117117 } ;
118118
119- React . useEffect ( ( ) => {
120- if ( defaultActiveValueCells && defaultActiveValueCells ?. length > 0 ) {
121- setActiveValueCells ( defaultActiveValueCells )
122- }
123- } , [ defaultActiveValueCells ] ) ;
124-
125119 const isSelectable = ( option : DefaultOptionType ) => {
126120 if ( disabled ) {
127121 return false ;
0 commit comments