diff --git a/src/core/util/util.js b/src/core/util/util.js index 8a6ffd950a6..14014a53168 100644 --- a/src/core/util/util.js +++ b/src/core/util/util.js @@ -72,8 +72,16 @@ angular.module('material.core') var restoreStyle = disableTarget.attr('style'); var computedStyle = $window.getComputedStyle(disableTarget[0]); + var disableRect = disableTarget[0].getBoundingClientRect(); + + var widthOffset = disableRect.left + parseFloat(computedStyle.paddingLeft, 10) - parseFloat(computedStyle.marginLeft, 10); + + + computeScrollbars(computedStyle); + wrapperEl.attr('layout-margin', disableTarget.attr('layout-margin')); + wrapperEl.css({ overflow: 'hidden', position: 'fixed', @@ -88,7 +96,10 @@ angular.module('material.core') '-ms-flex': computedStyle.msFlex, flex: computedStyle.flex, 'padding-top': computedStyle.paddingTop, + 'margin-top': '0px', + 'margin-left': computedStyle.marginLeft, top: (-1 * heightOffset) + 'px', + left: widthOffset + 'px', width: '100%' });