material icon indicating copy to clipboard operation
material copied to clipboard

md-dialog backdrop displays incorrectly if page is scrolled

Open dozingcat opened this issue 11 years ago • 13 comments

See http://codepen.io/anon/pen/ZYVpWo . Scroll down and click the button; the dialog backdrop will not cover the entire frame, and sometimes showing the dialog causes the page to unexpectedly jump.

dozingcat avatar Mar 19 '15 16:03 dozingcat

maybe this could help you.... md-backdrop{ position: fixed; }

dominikstrasser avatar Mar 21 '15 15:03 dominikstrasser

The same is true for the bottom sheet.

I have a PR for the md-backdrop in #2023.

wesalvaro avatar Mar 28 '15 10:03 wesalvaro

I think this is also connected to #1830 It happens also with sidenavs and scrolled content.

david-gang avatar May 10 '15 08:05 david-gang

Hey guys! This ticket is really important.

Just to complement: position fixed to backdrop won't solve the problem completely. You must also change the class .md-dialog-is-showing on body ( overflow: hidden) to overflow: visible.

ivanhtp avatar May 22 '15 14:05 ivanhtp

+1

alexthewilde avatar Jun 11 '15 18:06 alexthewilde

Quick fiddle to demonstrate this is still a very present bug:

http://output.jsbin.com/yotiloniri

Just make sure to shrink the screen vertically smaller than the content (the kitten picture).

wesalvaro avatar Jul 07 '15 17:07 wesalvaro

+1

oli107 avatar Jul 17 '15 23:07 oli107

Solution

Search object causing the problem. For example a <md-sidenav /> tag with a parent like a <div>. On the code...

<div>
  <md-sidenav>
     <!-- this md-sidenav tag is causing a warning -->
  </md-sidenav>
</div>

Fixing the problem...

<div style="position:fixed;">
  <md-sidenav>
     <!-- No more warning! :) -->
  </md-sidenav>
</div>

#4813

pablorsk avatar Aug 19 '16 17:08 pablorsk

the top offset of the <md-backdrop> element is not being properly calculated... adding:

md-backdrop {
    top: 0;
}

might help you, if this is the case.

stephengardner avatar Sep 26 '16 13:09 stephengardner

I managed to fix it with setting background from hex to rgba value with rgba(243, 246, 251, .99)

gglukmann avatar Dec 09 '16 13:12 gglukmann

Had the same problem, the body was getting custom styles added, a hacky fix:

/**
 * If we don't do this, angular material will break when loading modal windows
 * Don't remove this unless you have a better alternative
 */
body {
    top: 0 !important;
}

tavurth avatar Dec 19 '16 14:12 tavurth

To solve the incorrect position after the scrolling in iPad Safari, please try: .md-dialog-container{ position:fixed; top:0 !important; overflow:hidden; }

ImaginationHub avatar Jan 16 '17 06:01 ImaginationHub

Hi guys,

Only came across this now. But this is how you fix this error on mobi or web: On your CSS the above mentioned by @ImaginationHub didnt work for me. So i had to the following:

.md-dialog-container {
    position: fixed;
    top: 0 !important;
    overflow: hidden;
}

.md-dialog-is-showing {
    position: fixed;
    top: 0 !important;
    overflow: hidden;
}

Hope this helps :D

Kmasterrr avatar Sep 24 '17 14:09 Kmasterrr