mirror of
https://github.com/electron/electron.git
synced 2026-01-28 00:38:35 -05:00
fix: make sure that menu bar gets focus even when you click an item to focus it first (#19710)
This commit is contained in:
committed by
Charles Kerr
parent
9b1f698770
commit
27b2747b61
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user