@@ -323,6 +323,8 @@ export default function useAlign(
323
323
const [ popupPoint , targetPoint ] = placementInfo . points || [ ] ;
324
324
const targetPoints = splitPoints ( targetPoint ) ;
325
325
const popupPoints = splitPoints ( popupPoint ) ;
326
+ let tmpTargetPoints = targetPoints ;
327
+ let tmpPopupPoints = popupPoints ;
326
328
327
329
const targetAlignPoint = getAlignPoint ( targetRect , targetPoints ) ;
328
330
const popupAlignPoint = getAlignPoint ( popupRect , popupPoints ) ;
@@ -399,6 +401,11 @@ export default function useAlign(
399
401
}
400
402
syncNextPopupPosition ( ) ;
401
403
404
+ function updateTmpPopupPointsAndTmpTargetPoints ( ) {
405
+ tmpPopupPoints = splitPoints ( nextAlignInfo . points [ 0 ] ) ;
406
+ tmpTargetPoints = splitPoints ( nextAlignInfo . points [ 1 ] ) ;
407
+ }
408
+
402
409
// >>>>>>>>>> Top & Bottom
403
410
const needAdjustY = supportAdjust ( adjustY ) ;
404
411
@@ -443,9 +450,10 @@ export default function useAlign(
443
450
popupOffsetY = - popupOffsetY ;
444
451
445
452
nextAlignInfo . points = [
446
- reversePoints ( popupPoints , 0 ) ,
447
- reversePoints ( targetPoints , 0 ) ,
453
+ reversePoints ( tmpPopupPoints , 0 ) ,
454
+ reversePoints ( tmpTargetPoints , 0 ) ,
448
455
] ;
456
+ updateTmpPopupPointsAndTmpTargetPoints ( ) ;
449
457
} else {
450
458
prevFlipRef . current . bt = false ;
451
459
}
@@ -489,9 +497,10 @@ export default function useAlign(
489
497
popupOffsetY = - popupOffsetY ;
490
498
491
499
nextAlignInfo . points = [
492
- reversePoints ( popupPoints , 0 ) ,
493
- reversePoints ( targetPoints , 0 ) ,
500
+ reversePoints ( tmpPopupPoints , 0 ) ,
501
+ reversePoints ( tmpTargetPoints , 0 ) ,
494
502
] ;
503
+ updateTmpPopupPointsAndTmpTargetPoints ( ) ;
495
504
} else {
496
505
prevFlipRef . current . tb = false ;
497
506
}
@@ -542,9 +551,10 @@ export default function useAlign(
542
551
popupOffsetX = - popupOffsetX ;
543
552
544
553
nextAlignInfo . points = [
545
- reversePoints ( popupPoints , 1 ) ,
546
- reversePoints ( targetPoints , 1 ) ,
554
+ reversePoints ( tmpPopupPoints , 1 ) ,
555
+ reversePoints ( tmpTargetPoints , 1 ) ,
547
556
] ;
557
+ updateTmpPopupPointsAndTmpTargetPoints ( ) ;
548
558
} else {
549
559
prevFlipRef . current . rl = false ;
550
560
}
@@ -588,9 +598,10 @@ export default function useAlign(
588
598
popupOffsetX = - popupOffsetX ;
589
599
590
600
nextAlignInfo . points = [
591
- reversePoints ( popupPoints , 1 ) ,
592
- reversePoints ( targetPoints , 1 ) ,
601
+ reversePoints ( tmpPopupPoints , 1 ) ,
602
+ reversePoints ( tmpTargetPoints , 1 ) ,
593
603
] ;
604
+ updateTmpPopupPointsAndTmpTargetPoints ( ) ;
594
605
} else {
595
606
prevFlipRef . current . lr = false ;
596
607
}
0 commit comments