Browse Source

fix: check for pane focus before removing it. (#17164)

Fixes #16883. This bug seems to have been introduced in the #15302's
menu a11y refactor and is new in 5-0-x.
Charles Kerr 6 years ago
parent
commit
ed31cfebc9
1 changed files with 3 additions and 1 deletions
  1. 3 1
      atom/browser/ui/views/menu_bar.cc

+ 3 - 1
atom/browser/ui/views/menu_bar.cc

@@ -119,7 +119,9 @@ bool MenuBar::GetMenuButtonFromScreenPoint(const gfx::Point& screenPoint,
 }
 
 void MenuBar::OnBeforeExecuteCommand() {
-  RemovePaneFocus();
+  if (GetPaneFocusTraversable() != nullptr) {
+    RemovePaneFocus();
+  }
   window_->RestoreFocus();
 }