@@ -555,43 +555,43 @@ export default function useAlign(
555555 const numShiftX = shiftX === true ? 0 : shiftX ;
556556 if ( typeof numShiftX === 'number' ) {
557557 // Left
558- if ( nextPopupX < visibleArea . left ) {
559- nextOffsetX -= nextPopupX - visibleArea . left ;
558+ if ( nextPopupX < visibleRegionArea . left ) {
559+ nextOffsetX -= nextPopupX - visibleRegionArea . left ;
560560
561- if ( targetRect . x + targetWidth < visibleArea . left + numShiftX ) {
561+ if ( targetRect . x + targetWidth < visibleRegionArea . left + numShiftX ) {
562562 nextOffsetX +=
563- targetRect . x - visibleArea . left + targetWidth - numShiftX ;
563+ targetRect . x - visibleRegionArea . left + targetWidth - numShiftX ;
564564 }
565565 }
566566
567567 // Right
568- if ( nextPopupRight > visibleArea . right ) {
569- nextOffsetX -= nextPopupRight - visibleArea . right ;
568+ if ( nextPopupRight > visibleRegionArea . right ) {
569+ nextOffsetX -= nextPopupRight - visibleRegionArea . right ;
570570
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 ;
573573 }
574574 }
575575 }
576576
577577 const numShiftY = shiftY === true ? 0 : shiftY ;
578578 if ( typeof numShiftY === 'number' ) {
579579 // Top
580- if ( nextPopupY < visibleArea . top ) {
581- nextOffsetY -= nextPopupY - visibleArea . top ;
580+ if ( nextPopupY < visibleRegionArea . top ) {
581+ nextOffsetY -= nextPopupY - visibleRegionArea . top ;
582582
583- if ( targetRect . y + targetHeight < visibleArea . top + numShiftY ) {
583+ if ( targetRect . y + targetHeight < visibleRegionArea . top + numShiftY ) {
584584 nextOffsetY +=
585- targetRect . y - visibleArea . top + targetHeight - numShiftY ;
585+ targetRect . y - visibleRegionArea . top + targetHeight - numShiftY ;
586586 }
587587 }
588588
589589 // Bottom
590- if ( nextPopupBottom > visibleArea . bottom ) {
591- nextOffsetY -= nextPopupBottom - visibleArea . bottom ;
590+ if ( nextPopupBottom > visibleRegionArea . bottom ) {
591+ nextOffsetY -= nextPopupBottom - visibleRegionArea . bottom ;
592592
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 ;
595595 }
596596 }
597597 }
0 commit comments