11import Trigger from '@rc-component/trigger' ;
2- import type { AlignType } from '@rc-component/trigger/lib/interface' ;
2+ import type { AlignType , BuildInPlacements } from '@rc-component/trigger/lib/interface' ;
33import classNames from 'classnames' ;
44import * as React from 'react' ;
55import type { Placement , RenderDOMFunc } from './BaseSelect' ;
@@ -64,6 +64,7 @@ export interface SelectTriggerProps {
6464 transitionName ?: string ;
6565 containerWidth : number ;
6666 placement ?: Placement ;
67+ builtinPlacements ?: BuildInPlacements ;
6768 dropdownStyle : React . CSSProperties ;
6869 dropdownClassName : string ;
6970 direction : string ;
@@ -96,6 +97,7 @@ const SelectTrigger: React.RefForwardingComponent<RefTriggerProps, SelectTrigger
9697 dropdownClassName,
9798 direction = 'ltr' ,
9899 placement,
100+ builtinPlacements,
99101 dropdownMatchSelectWidth,
100102 dropdownRender,
101103 dropdownAlign,
@@ -114,9 +116,9 @@ const SelectTrigger: React.RefForwardingComponent<RefTriggerProps, SelectTrigger
114116 popupNode = dropdownRender ( popupElement ) ;
115117 }
116118
117- const builtInPlacements = React . useMemo (
118- ( ) => getBuiltInPlacements ( dropdownMatchSelectWidth ) ,
119- [ dropdownMatchSelectWidth ] ,
119+ const mergedBuiltinPlacements = React . useMemo (
120+ ( ) => builtinPlacements || getBuiltInPlacements ( dropdownMatchSelectWidth ) ,
121+ [ builtinPlacements , dropdownMatchSelectWidth ] ,
120122 ) ;
121123
122124 // ===================== Motion ======================
@@ -146,7 +148,7 @@ const SelectTrigger: React.RefForwardingComponent<RefTriggerProps, SelectTrigger
146148 showAction = { onPopupVisibleChange ? [ 'click' ] : [ ] }
147149 hideAction = { onPopupVisibleChange ? [ 'click' ] : [ ] }
148150 popupPlacement = { placement || ( direction === 'rtl' ? 'bottomRight' : 'bottomLeft' ) }
149- builtinPlacements = { builtInPlacements }
151+ builtinPlacements = { mergedBuiltinPlacements }
150152 prefixCls = { dropdownPrefixCls }
151153 popupTransitionName = { mergedTransitionName }
152154 popup = {
0 commit comments