Skip to content

Commit 6514607

Browse files
committed
Position: Properly handle flip collision when the window is scrolled. Fixes #8481 - Position in flip mode does not take into consideration scrollTop and scrollLeft.
1 parent af67883 commit 6514607

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ui/jquery.ui.position.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ $.ui.position = {
360360
var within = data.within,
361361
withinOffset = within.offset.left + within.scrollLeft,
362362
outerWidth = within.width,
363-
offsetLeft = within.isWindow ? 0 : within.offset.left,
363+
offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
364364
collisionPosLeft = position.left - data.collisionPosition.marginLeft,
365365
overLeft = collisionPosLeft - offsetLeft,
366366
overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
@@ -395,7 +395,7 @@ $.ui.position = {
395395
var within = data.within,
396396
withinOffset = within.offset.top + within.scrollTop,
397397
outerHeight = within.height,
398-
offsetTop = within.isWindow ? 0 : within.offset.top,
398+
offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
399399
collisionPosTop = position.top - data.collisionPosition.marginTop,
400400
overTop = collisionPosTop - offsetTop,
401401
overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,

0 commit comments

Comments
 (0)