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.

mdMenu: When one mdMenu is destroyed, other open mdMenus hide #7129

@rdantonio

Description

@rdantonio

Demo here: http://codepen.io/anon/pen/jWXJbb

You can see the issue by opening the first menu (Phone) and clicking on "Option 2", which will hide the second menu button (Envelope). When Envelope is hidden, the menu for Phone is hidden as well, even though md-prevent-menu-close is on the menu button. If you click Option 2 again on Phone it will show Envelope again and not close Phone's menu (correct behavior).

I think this is due to the commit for #6545, which adds this:

menuContainer.on('$destroy', function() {
      $mdMenu.destroy();
});

It doesn't check if the $mdMenu that's being destroyed is actually associated with the destroyed menu container.

Locally I have done this, which seems to work but not sure if it's a good fix:

menuContainer.on('$destroy', function () {
      if(self.isOpen) $mdMenu.destroy();
});

Thank you!

Metadata

Metadata

Assignees

Labels

P1: urgentUrgent issues that should be addressed in the next minor or patch release.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions