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: make sure that menu bar gets focus even when you click an item to focus it first #19764

Merged
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
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