@@ -3,7 +3,7 @@ import Trigger from 'rc-trigger';
33import classNames from 'classnames' ;
44import { RenderDOMFunc } from './interface' ;
55
6- const getBuiltInPlacements = ( dropdownMatchSelectWidth : number | true ) => {
6+ const getBuiltInPlacements = ( dropdownMatchSelectWidth : number | boolean ) => {
77 // Enable horizontal overflow auto-adjustment when a custom dropdown width is provided
88 const adjustX = typeof dropdownMatchSelectWidth !== 'number' ? 0 : 1 ;
99
@@ -52,10 +52,10 @@ export interface SelectTriggerProps {
5252 getTriggerDOMNode : ( ) => HTMLElement ;
5353}
5454
55- const SelectTrigger : React . RefForwardingComponent <
56- RefTriggerProps ,
57- SelectTriggerProps
58- > = ( props , ref ) => {
55+ const SelectTrigger : React . RefForwardingComponent < RefTriggerProps , SelectTriggerProps > = (
56+ props ,
57+ ref ,
58+ ) => {
5959 const {
6060 prefixCls,
6161 disabled,
@@ -83,15 +83,12 @@ const SelectTrigger: React.RefForwardingComponent<
8383 popupNode = dropdownRender ( popupElement ) ;
8484 }
8585
86- const builtInPlacements = React . useMemo (
87- ( ) => getBuiltInPlacements ( dropdownMatchSelectWidth ) ,
88- [ dropdownMatchSelectWidth ] ,
89- ) ;
86+ const builtInPlacements = React . useMemo ( ( ) => getBuiltInPlacements ( dropdownMatchSelectWidth ) , [
87+ dropdownMatchSelectWidth ,
88+ ] ) ;
9089
9190 // ===================== Motion ======================
92- const mergedTransitionName = animation
93- ? `${ dropdownPrefixCls } -${ animation } `
94- : transitionName ;
91+ const mergedTransitionName = animation ? `${ dropdownPrefixCls } -${ animation } ` : transitionName ;
9592
9693 // ======================= Ref =======================
9794 const popupRef = React . useRef < HTMLDivElement > ( null ) ;
@@ -135,9 +132,7 @@ const SelectTrigger: React.RefForwardingComponent<
135132 ) ;
136133} ;
137134
138- const RefSelectTrigger = React . forwardRef < RefTriggerProps , SelectTriggerProps > (
139- SelectTrigger ,
140- ) ;
135+ const RefSelectTrigger = React . forwardRef < RefTriggerProps , SelectTriggerProps > ( SelectTrigger ) ;
141136RefSelectTrigger . displayName = 'SelectTrigger' ;
142137
143138export default RefSelectTrigger ;
0 commit comments