md-select changes scroll position when closed #10588
Description
Actual Behavior:
What is the issue? *
md-select
changes scroll position on close in Firefox and IEWhat is the expected behavior?
The window should return to its original position before themd-select
is opened. In order to demonstrate this, you must put themd-select
in the context of a page with scrollable content.
I have a work around that uses md-on-open
and md-on-close
to record the original scroll position and then return the page to that position after angular material finishes its animation, but the user can see the page scrolling up and down and it does not look professional.
function recordYOffset () {
self.scrollYOffset = $window.pageYOffset
}
function returnToYOffset () {
$window.scroll(0, self.scrollYOffset)
}
CodePen (or steps to reproduce the issue): *
CodePen Demo which shows your issue:
I hope JSFiddle will do: https://jsfiddle.net/b7c357of/2/Details:
This issue proposes this solution:
_:-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%;
}
}
Unfortunately, it only works for IE, and furthermore it causes another problem. When you use this, it causes the div.md-select-menu-container
(and children) to scroll with the body instead of remaining fixed over the md-select
, as can be seen at this variant of the jsfiddle.
AngularJS Versions: *
AngularJS Version:
I'm using 1.5.3, the jsfiddle example uses 1.3.8AngularJS Material Version:
1.1.3
Additional Information:
Browser Type: *
Firefox, Internet ExplorerBrowser Version: *
Firefox 52.0.2 (64-bit), IE10, IE11OS: *
Mac, Windows 7, Windows 10Stack Traces:
Shortcut to create a new CodePen Demo.
Note: *
indicates required information. Without this information, your issue may be auto-closed.
Do not modify the titles or questions. Simply add your responses to the ends of the questions.
Add more lines if needed.