Material: menu-bar: opening on mouse hover

Created on 8 Apr 2016  路  10Comments  路  Source: angular/material

I'm using md-menu-bar to show a menu and the sub-menu with some nested sub-menu. I've added ng-click event to open the submenu. But the menu is still opening on mouse hover. How can I fix it?

urgent bug

Most helpful comment

My workaround:

<md-menu ng-repeat="a in $ctrl.actions" ng-mouseover="$ctrl.mouseover($event)">
<!-- menu stuff -->
</md-menu>
$ctrl.mouseover = function ($event) {
      // Prevent adjacent menus opening on mouseover
      $event.stopImmediatePropagation();
    };

All 10 comments

Can you please provide a Codepen which demonstrates the issue?

It's something like md-menu-bar demo. And I understand, that it's regular behaviour when submenu is opened on hover, but it's a little bit inconvenient for my needs. And there is problem with it on smartphone. When I open one of submenus and then try to open another one, the second one doesn't close. It's seen on attached screenshot.

screenshot_9

What smartphone/browser are you using that is causing issues. We can take a look.

Samsung Galaxy S4, Android 5.0.1, Google Chrome 49.0.2623.105

Thanks for the additional info; definitely see the issue!

Thanks a lot!

This issue is closed as part of our 鈥楽urge Focus on Material 2' efforts.
For details, see our forum posting @ http://bit.ly/1UhZyWs.

My workaround:

<md-menu ng-repeat="a in $ctrl.actions" ng-mouseover="$ctrl.mouseover($event)">
<!-- menu stuff -->
</md-menu>
$ctrl.mouseover = function ($event) {
      // Prevent adjacent menus opening on mouseover
      $event.stopImmediatePropagation();
    };

@dremie, you saved me :+1:

@dremie
Hi , I have the similar issue on the md menu hover but some changes are there. I created issue on github. Please give solution for the issue. I am giving github link below
codepen link codepen link
link

Was this page helpful?
0 / 5 - 0 ratings