From 433e536e6b31ed61d19fc2d2b31a01b05a2b0474 Mon Sep 17 00:00:00 2001 From: robjacobs Date: Tue, 21 Jun 2016 15:25:49 -0400 Subject: [PATCH] fix(modal): check for overflow hidden Check if appendToElement has scrolling disabled before adding the scrollbar padding. Fixes #6037 Closes #6041 --- src/modal/modal.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modal/modal.js b/src/modal/modal.js index a64533a74c..d797febac6 100644 --- a/src/modal/modal.js +++ b/src/modal/modal.js @@ -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'}); + } } }