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>(
752
752
// Visible
753
753
visible = { mergedOpen }
754
754
onClose = { onPopupClose }
755
+ alignedPlacement = { alignedPlacement }
755
756
// Range
756
757
range
757
758
>
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ export type PickerTriggerProps = {
54
54
placement ?: string ;
55
55
builtinPlacements ?: BuildInPlacements ;
56
56
direction ?: 'ltr' | 'rtl' ;
57
-
57
+ alignedPlacement : string ;
58
58
// Visible
59
59
visible : boolean ;
60
60
onClose : ( ) => void ;
@@ -72,15 +72,15 @@ function PickerTrigger({
72
72
placement,
73
73
builtinPlacements = BUILT_IN_PLACEMENTS ,
74
74
direction,
75
-
75
+ alignedPlacement ,
76
76
// Visible
77
77
visible,
78
78
onClose,
79
79
} : PickerTriggerProps ) {
80
80
const { prefixCls, setAlignedPlacement } = React . useContext ( PickerContext ) ;
81
81
const dropdownPrefixCls = `${ prefixCls } -dropdown` ;
82
82
83
- const realPlacement = getRealPlacement ( placement , direction === 'rtl' ) ;
83
+ const realPlacement = getRealPlacement ( alignedPlacement || placement , direction === 'rtl' ) ;
84
84
85
85
return (
86
86
< Trigger
@@ -102,13 +102,13 @@ function PickerTrigger({
102
102
getPopupContainer = { getPopupContainer }
103
103
onPopupAlign = { ( _ , align ) => {
104
104
if ( ! setAlignedPlacement ) return ;
105
-
105
+
106
106
const matchedKey = Object . keys ( BUILT_IN_PLACEMENTS ) . find (
107
107
( key ) =>
108
108
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 ] ,
110
110
) ;
111
-
111
+
112
112
if ( matchedKey ) {
113
113
setAlignedPlacement ( matchedKey ) ;
114
114
}
You can’t perform that action at this time.
0 commit comments