File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -752,6 +752,7 @@ function RangePicker<DateType extends object = any>(
752752 // Visible
753753 visible = { mergedOpen }
754754 onClose = { onPopupClose }
755+ alignedPlacement = { alignedPlacement }
755756 // Range
756757 range
757758 >
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ export type PickerTriggerProps = {
5454 placement ?: string ;
5555 builtinPlacements ?: BuildInPlacements ;
5656 direction ?: 'ltr' | 'rtl' ;
57-
57+ alignedPlacement : string ;
5858 // Visible
5959 visible : boolean ;
6060 onClose : ( ) => void ;
@@ -72,15 +72,15 @@ function PickerTrigger({
7272 placement,
7373 builtinPlacements = BUILT_IN_PLACEMENTS ,
7474 direction,
75-
75+ alignedPlacement ,
7676 // Visible
7777 visible,
7878 onClose,
7979} : PickerTriggerProps ) {
8080 const { prefixCls, setAlignedPlacement } = React . useContext ( PickerContext ) ;
8181 const dropdownPrefixCls = `${ prefixCls } -dropdown` ;
8282
83- const realPlacement = getRealPlacement ( placement , direction === 'rtl' ) ;
83+ const realPlacement = getRealPlacement ( alignedPlacement || placement , direction === 'rtl' ) ;
8484
8585 return (
8686 < Trigger
@@ -102,13 +102,13 @@ function PickerTrigger({
102102 getPopupContainer = { getPopupContainer }
103103 onPopupAlign = { ( _ , align ) => {
104104 if ( ! setAlignedPlacement ) return ;
105-
105+
106106 const matchedKey = Object . keys ( BUILT_IN_PLACEMENTS ) . find (
107107 ( key ) =>
108108 BUILT_IN_PLACEMENTS [ key ] . points [ 0 ] === align . points [ 0 ] &&
109- BUILT_IN_PLACEMENTS [ key ] . points [ 1 ] === align . points [ 1 ]
109+ BUILT_IN_PLACEMENTS [ key ] . points [ 1 ] === align . points [ 1 ] ,
110110 ) ;
111-
111+
112112 if ( matchedKey ) {
113113 setAlignedPlacement ( matchedKey ) ;
114114 }
You can’t perform that action at this time.
0 commit comments