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

fix(menu): menu focus is lost when menu-item has custom content #12058

Merged
merged 1 commit into from
Dec 16, 2020

Conversation

Splaktar
Copy link
Contributor

PR Checklist

Please check your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added or this is not a bug fix / enhancement
  • Docs have been added, updated, or were not required

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Enhancement
[ ] Documentation content changes
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

  • menu focus is lost when menu-item has custom content and the first child of the md-menu-item is a disabled custom element

Fixes #12054

What is the new behavior?

  • check that the firstElementChild doesn't have the disabled attribute set as well
  • this supports ng-disabled and disabled on a custom element

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

- and the first child of the `md-menu-item` is a disabled custom element
- check that the firstElementChild doesn't have the disabled attribute set as well
- this supports `ng-disabled` and `disabled` on a custom element

Fixes #12054
@google-cla google-cla bot added the cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ label Dec 15, 2020
@Splaktar Splaktar added this to the 1.2.2 milestone Dec 15, 2020
@Splaktar Splaktar self-assigned this Dec 15, 2020
@Splaktar Splaktar added a11y This issue is related to accessibility P3: important Important issues that really should be fixed when possible. ui: focus labels Dec 15, 2020
@Splaktar Splaktar requested a review from mmalerba December 15, 2020 01:03
@Splaktar Splaktar added the pr: merge ready This PR is ready for a caretaker to review label Dec 15, 2020
Copy link
Contributor

@mmalerba mmalerba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Splaktar Splaktar added the pr: lgtm This PR has been approved by the reviewer label Dec 16, 2020
@Splaktar Splaktar merged commit 6391b13 into master Dec 16, 2020
@Splaktar Splaktar deleted the menu-fix-custom-element-focus branch December 16, 2020 21:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a11y This issue is related to accessibility cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ P3: important Important issues that really should be fixed when possible. pr: lgtm This PR has been approved by the reviewer pr: merge ready This PR is ready for a caretaker to review ui: focus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

menu: focus lost when opening with keyboard and first item is disabled
2 participants