-
Notifications
You must be signed in to change notification settings - Fork 3.4k
md-select changes scroll position when closed #10588
Comments
Could you check if #10549 does fix your issue? |
I'm happy to try that. I just noticed you released a new version - is it in 1.1.4? I've updated and that doesn't seem to do the job. Can you point me in the right direction for building from source? I see in the README that you just use dist/angular-material.js but I'm not sure how to use that. I'm using npm. Any tips you can offer would be much appreciated. |
@EightArmCode Unfortunately, I has not been merged yet, so it's only in my pull request right now.
PLEASE NOTE: I have forked that library just to make that fix, please don't use it in production code. But if this fixes your issue, I would like to ask you to leave a thumbs up in my pull request, so that it gets more attention from repository owners. |
@EightArmCode i'm trying to figure out what's wrong, |
Hi - From my post: "md-select changes scroll position on close in Firefox and IE" More from the original post: "What is the expected behavior? The window should return to its original position before the md-select is opened. In order to demonstrate this, you must put the md-select in the context of a page with scrollable content." The other issue I linked to provides a solution that only works in IE and not FF, and also doesn't work if your select has a scrollable parent. What more clarity can I add here that might help? @veritas I have not had a moment to test your solution yet, and I'm not sure I can tell you when I might get around to it. My hack/fix works well enough for the time being. That said, of course we all would love to see some sort of fix realized. Perhaps I'll try to find some time for it this weekend. |
Here is a workaround. Just move the scroll from the body element to an inner element like below: <body>
<div id="container">
</div>
<body> body {
height: 100%;
width: 100%;
overflow: hidden;
}
#container {
height: 100%;
width: 100%;
overflow-y: scroll;
} |
The linked fiddle is working properly now (it depends on master) that the fix went into 1.1.5 and is still working in 1.1.7. Tested with Firefox 58. |
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
andmd-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.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: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 themd-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.3Additional 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.The text was updated successfully, but these errors were encountered: