material icon indicating copy to clipboard operation
material copied to clipboard

md-select causes page to jump when an option is clicked, only in IE

Open danneniko opened this issue 11 years ago • 6 comments

md-select causes page to jump when an option is clicked, only in IE. Works fine in chrome and FF. But trying in IE11, it does this. Any workarounds?

danneniko avatar Sep 15 '15 11:09 danneniko

Actually, the problem is not with md-select but with the backdrop/click-catcher that is applied to the page when components like selects or dialogs are opened. For some reason, IE doesn't like offsetting the <body> position and modifying its width.

I managed to hotfix this in my codebase like this (SCSS):

_:-ms-input-placeholder, :root {
  body[style] {
    position: inherit !important;
    top: inherit !important;
    width: inherit !important;
  }

  .md-click-catcher.md-wbTheme-theme {
    height: 100%;
    position: fixed;
    width: 100%;
  }
}

This prevents the page from jumping when a select is closed, but the whole thing is broken nonetheless, performance on IE is still really bad, and this is a dirty fix.

wolfika avatar Nov 07 '15 10:11 wolfika

thanks @wolfika thats what i am looking for

GTarifshabbir avatar Feb 11 '16 11:02 GTarifshabbir

@wolfika Thanks for the solution. This solves the page jump issue when we open the md-select dropdown. But when we select any option from the dropdown that time page jumps. Is there any fix for the same?

Pravin-Parkhi avatar Feb 07 '17 17:02 Pravin-Parkhi

This fix actually caused a different problem for me. With this solution applied, the open menu does not remain positioned above its parent element, but instead scrolls with the page.

EightArmCode avatar Apr 14 '17 13:04 EightArmCode

Is there an equivalent workaround for md-dialog similar to the one above by @wolfika?

alecpirillo avatar May 02 '17 01:05 alecpirillo

Here is my workaround for md-dialog

Here is a workaround. Just move the scroll from the body element to an inner element like below:

< body>
< div id="container">
< /div>
< body>
// Style
body{
height: 100%;
width: 100%;
overflow: hidden;
}
#container{
height: 100%;
width: 100%;
overflow-y: scroll;
}

imannorouzi avatar Sep 27 '17 02:09 imannorouzi