Commit 206d0eb2 authored by Leonard Grey's avatar Leonard Grey Committed by Commit Bot

Fix action menu a11y tree

Currently, CrActionMenu's a11y tree looks like:

Menu
  Group (wrapper div)
    Menu item 1
    Menu item
    ...

On macOS, this causes VoiceOver to interpret the wrapper as the sole
item in the menu, and to read the wrapper's generated a11y name, which
is the concatenation of the menu items.

This change removes the wrapper from the a11y hierarchy. Removing the
tabindex is necessary since an explicitly set tabindex overrides
`role=none`.

Bug: 947222
Change-Id: Ice8124b1b19ce04773f8fe7e0fda54755fdcfd3d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1776223Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#692085}
parent 4d3b2347
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
</style> </style>
<dialog id="dialog" tabindex="0" on-close="onNativeDialogClose_" role="menu" <dialog id="dialog" tabindex="0" on-close="onNativeDialogClose_" role="menu"
aria-label$="[[ariaLabel]]"> aria-label$="[[ariaLabel]]">
<div class="item-wrapper" tabindex="-1"> <div class="item-wrapper" role="none">
<slot id="contentNode"></slot> <slot id="contentNode"></slot>
</div> </div>
</dialog> </dialog>
......
...@@ -358,6 +358,7 @@ Polymer({ ...@@ -358,6 +358,7 @@ Polymer({
anchorAlignmentX: AnchorAlignment.BEFORE_END, anchorAlignmentX: AnchorAlignment.BEFORE_END,
}, },
opt_config))); opt_config)));
this.$.dialog.focus();
}, },
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment