Skip to content

Commit

Permalink
fix(modal): check for overflow hidden
Browse files Browse the repository at this point in the history
Check if appendToElement has scrolling disabled before adding
the scrollbar padding.

Fixes angular-ui#6037
Closes angular-ui#6041
  • Loading branch information
RobJacobs committed Jun 21, 2016
1 parent 1ec0997 commit 433e536
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/modal/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,11 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap', 'ui.bootstrap.p
}
$compile(backdropDomEl)(backdropScope);
$animate.enter(backdropDomEl, appendToElement);
scrollbarPadding = $uibPosition.scrollbarPadding(appendToElement);
if (scrollbarPadding.heightOverflow && scrollbarPadding.scrollbarWidth) {
appendToElement.css({paddingRight: scrollbarPadding.right + 'px'});
if ($uibPosition.isScrollable(appendToElement)) {
scrollbarPadding = $uibPosition.scrollbarPadding(appendToElement);
if (scrollbarPadding.heightOverflow && scrollbarPadding.scrollbarWidth) {
appendToElement.css({paddingRight: scrollbarPadding.right + 'px'});
}
}
}

Expand Down

0 comments on commit 433e536

Please sign in to comment.