material icon indicating copy to clipboard operation
material copied to clipboard

select: opening menu causes body's scrollbar to disappear

Open zevenements opened this issue 9 years ago • 3 comments

We can see on the "official" CodePen : https://codepen.io/anon/pen/mmWGZj the parent scroll disappear when we click on the md-select. Actually, if we console.log the window.pageYOffset is set to 0 on top when md-select is selected because body style change. I've got the same issue on a app and it make me crazy..

This effect seems to depends on parent containers, but can't reproduce exactly when. Maybe this issue is already knew ?

Additional Information:

  • Browser Type: last chrome
  • OS: ubuntu 16.04*

thanks

zevenements avatar Apr 28 '17 22:04 zevenements

I write this on my css and it's seems to fix the problem, but maybe some sides effects could be appear.

body {
  height: auto !important;
  position: absolute !important;
  top: 0 !important;
  width: 100% !important;
}

zevenements avatar Apr 30 '17 01:04 zevenements

Just "height: auto !important;" needed on my body tag to fix it. Looks like the other options are not related at all. Thank you @zevenements

felorodri avatar May 22 '18 20:05 felorodri

This issue has an acceptable workaround so I'm going to close it. By design, we don't want the body to scroll when a select's menu is open. Only the options in the menu should be scrolled.

Splaktar avatar May 26 '18 23:05 Splaktar