Skip to content

Commit

Permalink
fix: make sure that menu bar gets focus even when you click an item t…
Browse files Browse the repository at this point in the history
…o focus it first (#19764)
  • Loading branch information
trop[bot] authored and codebytere committed Aug 15, 2019
1 parent 78a2237 commit 3dcf668
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions atom/browser/ui/views/menu_bar.cc
Expand Up @@ -268,6 +268,12 @@ void MenuBar::OnMenuButtonClicked(views::Button* source,
if (!window_->HasFocus())
window_->RequestFocus();

// This ensures that if you focus the menubar by clicking on an item, you can
// still use the arrow keys to move around
if (GetPaneFocusTraversable() == nullptr) {
SetPaneFocus(source);
}

int id = source->tag();
AtomMenuModel::ItemType type = menu_model_->GetTypeAt(id);
if (type != AtomMenuModel::TYPE_SUBMENU) {
Expand Down

0 comments on commit 3dcf668

Please sign in to comment.