@@ -555,43 +555,43 @@ export default function useAlign(
555
555
const numShiftX = shiftX === true ? 0 : shiftX ;
556
556
if ( typeof numShiftX === 'number' ) {
557
557
// Left
558
- if ( nextPopupX < visibleArea . left ) {
559
- nextOffsetX -= nextPopupX - visibleArea . left ;
558
+ if ( nextPopupX < visibleRegionArea . left ) {
559
+ nextOffsetX -= nextPopupX - visibleRegionArea . left ;
560
560
561
- if ( targetRect . x + targetWidth < visibleArea . left + numShiftX ) {
561
+ if ( targetRect . x + targetWidth < visibleRegionArea . left + numShiftX ) {
562
562
nextOffsetX +=
563
- targetRect . x - visibleArea . left + targetWidth - numShiftX ;
563
+ targetRect . x - visibleRegionArea . left + targetWidth - numShiftX ;
564
564
}
565
565
}
566
566
567
567
// Right
568
- if ( nextPopupRight > visibleArea . right ) {
569
- nextOffsetX -= nextPopupRight - visibleArea . right ;
568
+ if ( nextPopupRight > visibleRegionArea . right ) {
569
+ nextOffsetX -= nextPopupRight - visibleRegionArea . right ;
570
570
571
- if ( targetRect . x > visibleArea . right - numShiftX ) {
572
- nextOffsetX += targetRect . x - visibleArea . right + numShiftX ;
571
+ if ( targetRect . x > visibleRegionArea . right - numShiftX ) {
572
+ nextOffsetX += targetRect . x - visibleRegionArea . right + numShiftX ;
573
573
}
574
574
}
575
575
}
576
576
577
577
const numShiftY = shiftY === true ? 0 : shiftY ;
578
578
if ( typeof numShiftY === 'number' ) {
579
579
// Top
580
- if ( nextPopupY < visibleArea . top ) {
581
- nextOffsetY -= nextPopupY - visibleArea . top ;
580
+ if ( nextPopupY < visibleRegionArea . top ) {
581
+ nextOffsetY -= nextPopupY - visibleRegionArea . top ;
582
582
583
- if ( targetRect . y + targetHeight < visibleArea . top + numShiftY ) {
583
+ if ( targetRect . y + targetHeight < visibleRegionArea . top + numShiftY ) {
584
584
nextOffsetY +=
585
- targetRect . y - visibleArea . top + targetHeight - numShiftY ;
585
+ targetRect . y - visibleRegionArea . top + targetHeight - numShiftY ;
586
586
}
587
587
}
588
588
589
589
// Bottom
590
- if ( nextPopupBottom > visibleArea . bottom ) {
591
- nextOffsetY -= nextPopupBottom - visibleArea . bottom ;
590
+ if ( nextPopupBottom > visibleRegionArea . bottom ) {
591
+ nextOffsetY -= nextPopupBottom - visibleRegionArea . bottom ;
592
592
593
- if ( targetRect . y > visibleArea . bottom - numShiftY ) {
594
- nextOffsetY += targetRect . y - visibleArea . bottom + numShiftY ;
593
+ if ( targetRect . y > visibleRegionArea . bottom - numShiftY ) {
594
+ nextOffsetY += targetRect . y - visibleRegionArea . bottom + numShiftY ;
595
595
}
596
596
}
597
597
}
0 commit comments