Browse Source

#5366, #5975 - Fixes open rightward/leftward incorrectly adjusting to scroll context

pull/5603/merge
Jack 6 years ago
parent
commit
c598892997
1 changed files with 2 additions and 1 deletions
  1. 3
      src/definitions/modules/dropdown.js

3
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;

Loading…
Cancel
Save