Skip to content

bug(menu): mdMenu (close) output only called after menu-item clicked, not when menu is closed by clicking on overlay #3295

Closed

Description

Bug, feature request, or proposal:

BUG

What is the expected behavior?

MdMenu close output should be called whenever the menu is closed.

What is the current behavior?

MdMenu close output is only called when the menu is closed after clicking a menu-item. The close output is not called when the menu is closed by clicking away from the menu and on the overlay backdrop.

What are the steps to reproduce?

Create an MdMenu with (close)="console.log('test')".
Close the menu by clicking on the menu-items and by clicking on the overlay/backdrop.
Notice the console outputs.

A Plunker, when the menu button is clicked, closed is set to false. When the menu close output is emitted, closed is set to true. You can see that if you close the menu by clicking outside from the overlay/backdrop, closed does not get set to true. If you close the menu by clicking on one of the menu-items, closed is set to true.
http://plnkr.co/edit/zWePeOD6sPZm1kqWc5P4

Which versions of Angular, Material, OS, browsers are affected?

Angular 2.4.8
Material2 2.0.0-beta.2
Currently on: Chrome, OSX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions