Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix menubar focus trap #62869

Merged
merged 3 commits into from Nov 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -183,6 +183,7 @@
-webkit-app-region: no-drag;
zoom: 1;
white-space: nowrap;
outline: 0;
}

.monaco-workbench .menubar .menubar-menu-items-holder {
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/browser/parts/titlebar/menubarControl.ts
Expand Up @@ -696,7 +696,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);
Expand Down Expand Up @@ -840,9 +840,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();
Expand Down