Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

md-menu does not close with Esc key when first menu-item is disabled #9165

Closed
siddhantpp opened this issue Jul 28, 2016 · 1 comment
Closed
Assignees
Labels
has: Pull Request A PR has been created to address this issue
Milestone

Comments

@siddhantpp
Copy link

Actual Behavior:

  • What is the issue? * When the first item in a md-menu is disabled, it refuses to close on pressing Esc
  • What is the expected behavior? md-Menu should close on pressing Esc regardless of whether the first item is disabled or not.

CodePen (or steps to reproduce the issue): * CodePen link provided.

Angular Versions: *

  • Angular Version: 1.5.5
  • Angular Material Version: 1.0.9

Additional Information:

  • Browser Type: * Google Chrome
  • Browser Version: *51.0.2704.106 m (64-bit)
  • OS: * Windows 7
  • Stack Traces: None

Shortcut to create a new CodePen Demo.
Note: * indicates required information. Without this information, your issue may be auto-closed.

Do not modify the titles or questions. Simply add your responses to the ends of the questions.
Add more lines if needed.

@siddhantpp siddhantpp changed the title md-menu does not close with Esc key when all menu-items are disabled md-menu does not close with Esc key when first menu-item is disabled Jul 28, 2016
@clshortfuse clshortfuse self-assigned this Jul 30, 2016
@clshortfuse
Copy link
Contributor

clshortfuse commented Jul 30, 2016

It's likely due to the lack of a disabled attribute check here: https://github.com/angular/material/blob/master/src/components/menu/js/menuController.js#L165

as seen properly implemented here: https://github.com/angular/material/blob/master/src/components/menu/js/menuController.js#L105

It also explains why you can hover over Enabled and then press escape after disabling the first item.

clshortfuse added a commit to clshortfuse/material that referenced this issue Aug 3, 2016
Iterate through menu items until it finds a non disabled item

Previously, menu would attempt to focus first item. If the item
was disabled, no attempts were made to seek another focusable item.

Fixes angular#9165
@clshortfuse clshortfuse added the has: Pull Request A PR has been created to address this issue label Aug 3, 2016
@ThomasBurleson ThomasBurleson added this to the 1.1.2 milestone Aug 22, 2016
clshortfuse added a commit to clshortfuse/material that referenced this issue Sep 11, 2016
Iterate through menu items until it finds a non disabled item

Previously, menu would attempt to focus first item. If the item
was disabled, no attempts were made to seek another focusable item.

Fixes angular#9165
clshortfuse added a commit to clshortfuse/material that referenced this issue Sep 11, 2016
Iterate through menu items until it finds a non disabled item

Previously, menu would attempt to focus first item. If the item
was disabled, no attempts were made to seek another focusable item.

Fixes angular#9165
clshortfuse added a commit to clshortfuse/material that referenced this issue Sep 11, 2016
Previously, menu would attempt to focus first item. If the item
was disabled, no attempts were made to seek another focusable item.

* Iterate through menu items until it finds a non-disabled item
* Add more menu items to autofocus spec tests

Fixes angular#9165
clshortfuse added a commit to clshortfuse/material that referenced this issue Sep 11, 2016
Previously, menu would attempt to focus first item. If the item
was disabled, no attempts were made to seek another focusable item.

* Iterate through menu items until it finds a non-disabled item
* Add more menu items to autofocus spec tests

Fixes angular#9165
jelbourn pushed a commit that referenced this issue Sep 21, 2016
Previously, menu would attempt to focus first item. If the item
was disabled, no attempts were made to seek another focusable item.

* Iterate through menu items until it finds a non-disabled item
* Add more menu items to autofocus spec tests

Fixes #9165
Frank3K pushed a commit to Frank3K/material that referenced this issue Oct 8, 2016
Previously, menu would attempt to focus first item. If the item
was disabled, no attempts were made to seek another focusable item.

* Iterate through menu items until it finds a non-disabled item
* Add more menu items to autofocus spec tests

Fixes angular#9165
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has: Pull Request A PR has been created to address this issue
Projects
None yet
Development

No branches or pull requests

3 participants