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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/components/menu/js/menuServiceProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ function MenuProvider($$interimElementProvider) {
if (focusTarget) {
break;
}
if (child.firstElementChild && !child.firstElementChild.disabled) {
// Need to check the attribute as well since this might be a custom element whose
// disabled property is undefined.
if (child.firstElementChild && !child.firstElementChild.disabled &&
!child.firstElementChild.getAttribute('disabled')) {
focusTarget = child.firstElementChild;
break;
}
Expand Down