Angular Material mdMenu onclose scrolls up pages in Firefox

I have a simple angular app with mdMenu at the bottom of the page. When you select an option, the page scrolls up. This only happens in firefox (tested on version 52.0.2).

Using angular ver. 1.6.4 Using angular material ver 1.1.3

Plnkr

<body>
<div style="height:1000px">This is top</div>
    <md-menu md-position-mode="target-right target">
        <md-button aria-label="Open demo menu" class="md-raised md-primary" ng-click="$mdOpenMenu($event)">
            Menu
        </md-button>
        <md-menu-content width="2">
            <md-menu-item>
                <md-button>
                    <div>
                        <p flex>
                            Option </p>
                    </div>
                </md-button>
            </md-menu-item>
        </md-menu-content>
    </md-menu>
</body>
+4
source share
2 answers
 angular.module('yourModule',[]).config( ['$anchorScrollProvider', 
        function($anchorScrollProvider) {
            $anchorScrollProvider.disableAutoScrolling();
        }]
    );

I solved the problem by disabling automatic scrolling. Be sure to clear your browser’s cache to ensure it works.

0
source

This is a bug, at the time of publication it was still not allowed and was blocked by github developers.

https://github.com/angular/material/issues/5690

, :

body  {
height: auto;
}

, div- DOM , .

, Magador  ( Chrome, IE Firefox )

: http://codepen.io/Magador/pen/ZbmeRo

: http://codepen.io/Magador/pen/wKRBLg

0

Source: https://habr.com/ru/post/1674754/


All Articles