@@ -93,7 +93,7 @@ export interface TreeSelectProps<ValueType = any, OptionType extends DataNode =
93
93
listHeight ?: number ;
94
94
listItemHeight ?: number ;
95
95
listItemScrollOffset ?: number ;
96
- onDropdownVisibleChange ?: ( open : boolean ) => void ;
96
+ onPopupVisibleChange ?: ( open : boolean ) => void ;
97
97
treeTitleRender ?: ( node : OptionType ) => React . ReactNode ;
98
98
99
99
// >>> Tree
@@ -163,8 +163,8 @@ const TreeSelect = React.forwardRef<BaseSelectRef, TreeSelectProps>((props, ref)
163
163
listItemHeight = 20 ,
164
164
listItemScrollOffset = 0 ,
165
165
166
- onDropdownVisibleChange ,
167
- dropdownMatchSelectWidth = true ,
166
+ onPopupVisibleChange ,
167
+ popupMatchSelectWidth = true ,
168
168
169
169
// Tree
170
170
treeLine,
@@ -582,22 +582,13 @@ const TreeSelect = React.forwardRef<BaseSelectRef, TreeSelectProps>((props, ref)
582
582
) ;
583
583
584
584
// ========================== Dropdown ==========================
585
- const onInternalDropdownVisibleChange = React . useCallback (
585
+ const onInternalPopupVisibleChange = React . useCallback (
586
586
( open : boolean ) => {
587
- if ( onDropdownVisibleChange ) {
588
- const legacyParam = { } ;
589
-
590
- Object . defineProperty ( legacyParam , 'documentClickClose' , {
591
- get ( ) {
592
- warning ( false , 'Second param of `onDropdownVisibleChange` has been removed.' ) ;
593
- return false ;
594
- } ,
595
- } ) ;
596
-
597
- ( onDropdownVisibleChange as any ) ( open , legacyParam ) ;
587
+ if ( onPopupVisibleChange ) {
588
+ onPopupVisibleChange ( open ) ;
598
589
}
599
590
} ,
600
- [ onDropdownVisibleChange ] ,
591
+ [ onPopupVisibleChange ] ,
601
592
) ;
602
593
603
594
// ====================== Display Change ========================
@@ -619,7 +610,7 @@ const TreeSelect = React.forwardRef<BaseSelectRef, TreeSelectProps>((props, ref)
619
610
const treeSelectContext = React . useMemo < TreeSelectContextProps > ( ( ) => {
620
611
return {
621
612
virtual,
622
- dropdownMatchSelectWidth ,
613
+ popupMatchSelectWidth ,
623
614
listHeight,
624
615
listItemHeight,
625
616
listItemScrollOffset,
@@ -636,7 +627,7 @@ const TreeSelect = React.forwardRef<BaseSelectRef, TreeSelectProps>((props, ref)
636
627
} ;
637
628
} , [
638
629
virtual ,
639
- dropdownMatchSelectWidth ,
630
+ popupMatchSelectWidth ,
640
631
listHeight ,
641
632
listItemHeight ,
642
633
listItemScrollOffset ,
@@ -716,8 +707,8 @@ const TreeSelect = React.forwardRef<BaseSelectRef, TreeSelectProps>((props, ref)
716
707
// >>> Options
717
708
OptionList = { OptionList }
718
709
emptyOptions = { ! mergedTreeData . length }
719
- onDropdownVisibleChange = { onInternalDropdownVisibleChange }
720
- dropdownMatchSelectWidth = { dropdownMatchSelectWidth }
710
+ onPopupVisibleChange = { onInternalPopupVisibleChange }
711
+ popupMatchSelectWidth = { popupMatchSelectWidth }
721
712
/>
722
713
</ LegacyContext . Provider >
723
714
</ TreeSelectContext . Provider >
0 commit comments