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

@YeomansIII

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

Activity

  1. added a commit that references this issue on Feb 25, 2017
    4d8b8fa
  2. self-assigned this
    on Feb 25, 2017
  3. added
    P3
    on Feb 28, 2017
  4. added a commit that references this issue on Mar 9, 2017
    0f28daf
  5. added a commit that references this issue on Apr 16, 2017
    ac476e4
  6. angular-automatic-lock-bot commented on Sep 5, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  7. locked and limited conversation to collaborators on Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions