From c5988929973156915e797f76b13a714ffbda4ae9 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 28 Jan 2018 18:21:26 -0800 Subject: [PATCH] #5366, #5975 - Fixes open rightward/leftward incorrectly adjusting to scroll context --- src/definitions/modules/dropdown.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/definitions/modules/dropdown.js b/src/definitions/modules/dropdown.js index 61d9619ea..a37438001 100644 --- a/src/definitions/modules/dropdown.js +++ b/src/definitions/modules/dropdown.js @@ -3259,6 +3259,7 @@ $.fn.dropdown = function(parameters) { ; calculations = { context: { + offset : $context.offset(), scrollLeft : $context.scrollLeft(), width : $context.outerWidth() }, @@ -3270,7 +3271,7 @@ $.fn.dropdown = function(parameters) { if(module.is.horizontallyScrollableContext()) { calculations.menu.offset.left += calculations.context.scrollLeft; } - isOffscreenRight = (calculations.menu.offset.left + calculations.menu.width >= calculations.context.scrollLeft + calculations.context.width); + isOffscreenRight = (calculations.menu.offset.left - calculations.context.offset.left + calculations.menu.width >= calculations.context.scrollLeft + calculations.context.width); if(isOffscreenRight) { module.verbose('Dropdown cannot fit in context rightward', isOffscreenRight); canOpenRightward = false;