From 27b2747b615ff2d300ccd9199e34b41409005c6b Mon Sep 17 00:00:00 2001 From: Heilig Benedek Date: Thu, 15 Aug 2019 03:11:41 +0200 Subject: [PATCH] fix: make sure that menu bar gets focus even when you click an item to focus it first (#19710) --- shell/browser/ui/views/menu_bar.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shell/browser/ui/views/menu_bar.cc b/shell/browser/ui/views/menu_bar.cc index 7fcf4b1d94..07a5d2a6f5 100644 --- a/shell/browser/ui/views/menu_bar.cc +++ b/shell/browser/ui/views/menu_bar.cc @@ -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) {