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.
This commit is contained in:
Charles Kerr 2019-03-04 09:47:59 -06:00 committed by GitHub
parent 8dcb5662e3
commit ed31cfebc9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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