Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit f9738f5

Browse files
crisbetoThomasBurleson
authored andcommitted
fix(dialog): backdrop being clipped
This reverts a change from #8349, which caused the backdrop to be clipped if the body was scrolled. Fixes #8602. Closes #8611
1 parent 112a3e4 commit f9738f5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/core/util/util.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,18 +227,20 @@ function UtilFactory($document, $timeout, $compile, $rootScope, $$mdAnimate, $in
227227
var restoreHtmlStyle = htmlNode.style.cssText || '';
228228
var restoreBodyStyle = body.style.cssText || '';
229229
var scrollOffset = $mdUtil.scrollTop(body);
230+
var clientWidth = body.clientWidth;
230231

231232
if (body.scrollHeight > body.clientHeight + 1) {
232233
applyStyles(body, {
233234
position: 'fixed',
234235
width: '100%',
235-
top: -scrollOffset + 'px',
236-
overflow: 'hidden'
236+
top: -scrollOffset + 'px'
237237
});
238238

239239
htmlNode.style.overflowY = 'scroll';
240240
}
241241

242+
if (body.clientWidth < clientWidth) applyStyles(body, {overflow: 'hidden'});
243+
242244
return function restoreScroll() {
243245
body.style.cssText = restoreBodyStyle;
244246
htmlNode.style.cssText = restoreHtmlStyle;

0 commit comments

Comments
 (0)