@@ -3,7 +3,7 @@ import Trigger from 'rc-trigger';
3
3
import classNames from 'classnames' ;
4
4
import { RenderDOMFunc } from './interface' ;
5
5
6
- const getBuiltInPlacements = ( dropdownMatchSelectWidth : number | true ) => {
6
+ const getBuiltInPlacements = ( dropdownMatchSelectWidth : number | boolean ) => {
7
7
// Enable horizontal overflow auto-adjustment when a custom dropdown width is provided
8
8
const adjustX = typeof dropdownMatchSelectWidth !== 'number' ? 0 : 1 ;
9
9
@@ -52,10 +52,10 @@ export interface SelectTriggerProps {
52
52
getTriggerDOMNode : ( ) => HTMLElement ;
53
53
}
54
54
55
- const SelectTrigger : React . RefForwardingComponent <
56
- RefTriggerProps ,
57
- SelectTriggerProps
58
- > = ( props , ref ) => {
55
+ const SelectTrigger : React . RefForwardingComponent < RefTriggerProps , SelectTriggerProps > = (
56
+ props ,
57
+ ref ,
58
+ ) => {
59
59
const {
60
60
prefixCls,
61
61
disabled,
@@ -83,15 +83,12 @@ const SelectTrigger: React.RefForwardingComponent<
83
83
popupNode = dropdownRender ( popupElement ) ;
84
84
}
85
85
86
- const builtInPlacements = React . useMemo (
87
- ( ) => getBuiltInPlacements ( dropdownMatchSelectWidth ) ,
88
- [ dropdownMatchSelectWidth ] ,
89
- ) ;
86
+ const builtInPlacements = React . useMemo ( ( ) => getBuiltInPlacements ( dropdownMatchSelectWidth ) , [
87
+ dropdownMatchSelectWidth ,
88
+ ] ) ;
90
89
91
90
// ===================== Motion ======================
92
- const mergedTransitionName = animation
93
- ? `${ dropdownPrefixCls } -${ animation } `
94
- : transitionName ;
91
+ const mergedTransitionName = animation ? `${ dropdownPrefixCls } -${ animation } ` : transitionName ;
95
92
96
93
// ======================= Ref =======================
97
94
const popupRef = React . useRef < HTMLDivElement > ( null ) ;
@@ -135,9 +132,7 @@ const SelectTrigger: React.RefForwardingComponent<
135
132
) ;
136
133
} ;
137
134
138
- const RefSelectTrigger = React . forwardRef < RefTriggerProps , SelectTriggerProps > (
139
- SelectTrigger ,
140
- ) ;
135
+ const RefSelectTrigger = React . forwardRef < RefTriggerProps , SelectTriggerProps > ( SelectTrigger ) ;
141
136
RefSelectTrigger . displayName = 'SelectTrigger' ;
142
137
143
138
export default RefSelectTrigger ;
0 commit comments