Index: ui/webui/resources/js/cr/ui/command.js |
diff --git a/ui/webui/resources/js/cr/ui/command.js b/ui/webui/resources/js/cr/ui/command.js |
index 83aa0b4f5db58d12b9161c319e9042e48e184633..1723dd7553c2892055d279c04ac746d970d890bb 100644 |
--- a/ui/webui/resources/js/cr/ui/command.js |
+++ b/ui/webui/resources/js/cr/ui/command.js |
@@ -262,6 +262,11 @@ cr.define('cr.ui', function() { |
// We do not want any other element to handle this. |
e.stopPropagation(); |
+ // When invoking a command via a shortcut, we have to manually check |
+ // if it can be executed, since focus might not have been changed |
+ // what would have updated the command's state. |
+ command.canExecuteChange(); |
+ |
command.execute(); |
return; |
} |