File tree Expand file tree Collapse file tree 2 files changed +27
-6
lines changed Expand file tree Collapse file tree 2 files changed +27
-6
lines changed Original file line number Diff line number Diff line change @@ -644,13 +644,9 @@ export default function useAlign(
644
644
645
645
// Additional calculate right & bottom position
646
646
const offsetX4Right =
647
- popupMirrorRect . right -
648
- popupRect . left -
649
- ( nextOffsetX + popupRect . width ) ;
647
+ popupMirrorRect . right - popupRect . x - ( nextOffsetX + popupRect . width ) ;
650
648
const offsetY4Bottom =
651
- popupMirrorRect . bottom -
652
- popupRect . top -
653
- ( nextOffsetY + popupRect . height ) ;
649
+ popupMirrorRect . bottom - popupRect . y - ( nextOffsetY + popupRect . height ) ;
654
650
655
651
setOffsetInfo ( {
656
652
ready : true ,
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ describe('Trigger.Align', () => {
23
23
y : 100 ,
24
24
width : 100 ,
25
25
height : 100 ,
26
+ right : 200 ,
27
+ bottom : 200 ,
26
28
} ) ,
27
29
} ) ;
28
30
@@ -233,4 +235,27 @@ describe('Trigger.Align', () => {
233
235
top : `50px` ,
234
236
} ) ;
235
237
} ) ;
238
+
239
+ it ( 'support dynamicInset' , async ( ) => {
240
+ render (
241
+ < Trigger
242
+ popupVisible
243
+ popup = { < span className = "bamboo" /> }
244
+ popupAlign = { {
245
+ points : [ 'bc' , 'tc' ] ,
246
+ _experimental : {
247
+ dynamicInset : true ,
248
+ } ,
249
+ } }
250
+ >
251
+ < div />
252
+ </ Trigger > ,
253
+ ) ;
254
+
255
+ await awaitFakeTimer ( ) ;
256
+
257
+ expect ( document . querySelector ( '.rc-trigger-popup' ) ) . toHaveStyle ( {
258
+ bottom : `100px` ,
259
+ } ) ;
260
+ } ) ;
236
261
} ) ;
You can’t perform that action at this time.
0 commit comments