Skip to content

Commit

Permalink
fix: check for pane focus before removing it.
Browse files Browse the repository at this point in the history
Fixes electron#16883. This bug seems to have been introduced in the electron#15302's
menu a11y refactor and is new in 5-0-x.
  • Loading branch information
ckerr authored and electron-bot committed Mar 4, 2019
1 parent 51c5882 commit 409d4c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion atom/browser/ui/views/menu_bar.cc
Expand Up @@ -118,7 +118,9 @@ bool MenuBar::GetMenuButtonFromScreenPoint(const gfx::Point& screenPoint,
}

void MenuBar::OnBeforeExecuteCommand() {
RemovePaneFocus();
if (GetPaneFocusTraversable() != nullptr) {
RemovePaneFocus();
}
window_->RestoreFocus();
}

Expand Down

0 comments on commit 409d4c8

Please sign in to comment.