Skip to content

Commit

Permalink
#5366, #5975 - Fixes open rightward/leftward incorrectly adjusting to…
Browse files Browse the repository at this point in the history
… scroll context
  • Loading branch information
jlukic committed Jan 29, 2018
1 parent 76678c5 commit c598892
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -3259,6 +3259,7 @@ $.fn.dropdown = function(parameters) {
;
calculations = {
context: {
offset : $context.offset(),
scrollLeft : $context.scrollLeft(),
width : $context.outerWidth()
},
Expand All @@ -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;
Expand Down

0 comments on commit c598892

Please sign in to comment.