Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

md-select changes scroll position when closed #10588

Closed
@EightArmCode

Description

@EightArmCode

Actual Behavior:

  • What is the issue? * md-select changes scroll position on close in Firefox and IE
  • 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.

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): *

     _:-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.8
  • AngularJS Material Version: 1.1.3

Additional Information:

  • Browser Type: * Firefox, Internet Explorer
  • Browser Version: * Firefox 52.0.2 (64-bit), IE10, IE11
  • OS: * Mac, Windows 7, Windows 10
  • Stack 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions