File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -178,8 +178,15 @@ export default class Position {
178178 if ( this . _isInViewport ( pinElement , align ) ) {
179179 return align ;
180180 } else if ( ! firstPositionResult ) {
181- const { right, bottom } = this . _getViewportOffset ( pinElement , align ) ;
182- firstPositionResult = { left : right < 0 ? left + right : left , top : top < 0 ? top + bottom : top } ;
181+ if ( this . needAdjust && ! this . autoFit ) {
182+ const { right, bottom } = this . _getViewportOffset ( pinElement , align ) ;
183+ firstPositionResult = {
184+ left : right < 0 ? left + right : left ,
185+ top : bottom < 0 ? top + bottom : top ,
186+ } ;
187+ } else {
188+ firstPositionResult = { left, top } ;
189+ }
183190 }
184191 }
185192
Original file line number Diff line number Diff line change @@ -600,6 +600,7 @@ describe('Overlay', () => {
600600 < div
601601 style = { {
602602 width : '200px' ,
603+ height : '100vh' ,
603604 background : 'red' ,
604605 } }
605606 >
@@ -615,6 +616,7 @@ describe('Overlay', () => {
615616 document . querySelector ( '.next-overlay-inner' ) . style . left ===
616617 `${ parseFloat ( window . getComputedStyle ( document . body ) . width ) - 200 - 1 } px` // Reason to subtract 1, see: Overly._isInViewport
617618 ) ;
619+ assert ( document . querySelector ( '.next-overlay-inner' ) . style . top === '0px' ) ;
618620 container . remove ( ) ;
619621 document . querySelector ( '.next-overlay-wrapper' ) . remove ( ) ;
620622 } ) ;
You can’t perform that action at this time.
0 commit comments