未验证 提交 f80c9296 编写于 作者: S SteVen Batten 提交者: GitHub

fix menubar focus trap (#62869)

* fix menubar focus trap

* undo tabindex on titlecontainer

* fix issue with falling back to native outline
上级 16a0994c
......@@ -183,6 +183,7 @@
-webkit-app-region: no-drag;
zoom: 1;
white-space: nowrap;
outline: 0;
}
.monaco-workbench .menubar .menubar-menu-items-holder {
......
......@@ -698,7 +698,7 @@ export class MenubarControl extends Disposable {
// Create the top level menu button element
if (firstTimeSetup) {
const buttonElement = $('div.menubar-menu-button', { 'role': 'menuitem', 'tabindex': 0, 'aria-label': cleanMenuLabel, 'aria-haspopup': true });
const buttonElement = $('div.menubar-menu-button', { 'role': 'menuitem', 'tabindex': -1, 'aria-label': cleanMenuLabel, 'aria-haspopup': true });
const titleElement = $('div.menubar-menu-title', { 'role': 'none', 'aria-hidden': true });
buttonElement.appendChild(titleElement);
......@@ -842,9 +842,9 @@ export class MenubarControl extends Disposable {
let eventHandled = true;
const key = !!e.key ? KeyCodeUtils.fromString(e.key) : KeyCode.Unknown;
if (event.equals(KeyCode.LeftArrow) || (event.shiftKey && event.keyCode === KeyCode.Tab)) {
if (event.equals(KeyCode.LeftArrow)) {
this.focusPrevious();
} else if (event.equals(KeyCode.RightArrow) || event.equals(KeyCode.Tab)) {
} else if (event.equals(KeyCode.RightArrow)) {
this.focusNext();
} else if (event.equals(KeyCode.Escape) && this.isFocused && !this.isOpen) {
this.setUnfocusedState();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册