Skip to content

Commit 54c2347

Browse files
committed
chore: Fix ts define
1 parent 57148ff commit 54c2347

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

src/SelectTrigger.tsx

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Trigger from 'rc-trigger';
33
import classNames from 'classnames';
44
import { 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);
141136
RefSelectTrigger.displayName = 'SelectTrigger';
142137

143138
export default RefSelectTrigger;

0 commit comments

Comments
 (0)