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

Commit 1fc7622

Browse files
committed
fix(dialog): incorrect dialog placement if page is scrolled
closes #4115
1 parent 9e814c9 commit 1fc7622

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/dialog/dialog.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,10 +755,11 @@ function MdDialogProvider($$interimElementProvider) {
755755

756756
var isFixed = $window.getComputedStyle($document[0].body).position == 'fixed';
757757
var backdrop = options.backdrop ? $window.getComputedStyle(options.backdrop[0]) : null;
758-
var height = backdrop ? Math.ceil(Math.abs(parseInt(backdrop.height, 10))) : 0;
758+
759+
var height = backdrop ? Math.min($document[0].body.clientHeight, Math.ceil(Math.abs(parseInt(backdrop.height, 10)))) : 0;
759760

760761
container.css({
761-
top: (isFixed ? $mdUtil.scrollTop(options.parent) / 2 : 0) + 'px',
762+
top: (isFixed ? $mdUtil.scrollTop(options.parent) : 0) + 'px',
762763
height: height ? height + 'px' : '100%'
763764
});
764765

0 commit comments

Comments
 (0)