Skip to content

Commit

Permalink
fix(modal): clicking on scrollbar with rtl enabled should not close t…
Browse files Browse the repository at this point in the history
…he modal
  • Loading branch information
lubber-de committed Oct 15, 2019
2 parents fb7b98c + 2d894f1 commit dd14fba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/definitions/modules/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ $.fn.modal = function(parameters) {

time = new Date().getTime(),
performance = [],
isRtl = $body.attr('dir') === 'rtl' || $body.css('direction') === 'rtl',

query = arguments[0],
methodInvoked = (typeof query == 'string'),
Expand Down Expand Up @@ -285,7 +286,7 @@ $.fn.modal = function(parameters) {
if(initialMouseDownInModal) {
module.verbose('Mouse down event registered inside the modal');
}
initialMouseDownInScrollbar = module.is.scrolling() && $(window).outerWidth() - settings.scrollbarWidth <= event.clientX;
initialMouseDownInScrollbar = module.is.scrolling() && ((!isRtl && $(window).outerWidth() - settings.scrollbarWidth <= event.clientX) || (isRtl && settings.scrollbarWidth >= event.clientX));
if(initialMouseDownInScrollbar) {
module.verbose('Mouse down event registered inside the scrollbar');
}
Expand Down

0 comments on commit dd14fba

Please sign in to comment.