Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1581)

Unified Diff: ui/webui/resources/js/cr/ui/context_menu_handler.js

Issue 2800383002: Stop blocking the mousedown event of left click when closing context menu. (Closed)
Patch Set: Update comment to be more descriptive of the change we make. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/js/cr/ui/context_menu_handler.js
diff --git a/ui/webui/resources/js/cr/ui/context_menu_handler.js b/ui/webui/resources/js/cr/ui/context_menu_handler.js
index ce31f6517b5021a2f723028df2e1b5a2805e0809..ab07f6c19d7e4d050b7a7cfca03fc8282db3d9f3 100644
--- a/ui/webui/resources/js/cr/ui/context_menu_handler.js
+++ b/ui/webui/resources/js/cr/ui/context_menu_handler.js
@@ -154,7 +154,9 @@ cr.define('cr.ui', function() {
case 'mousedown':
if (!this.menu.contains(e.target)) {
this.hideMenu();
- if (e.button == 0 /* Left click */) {
+ if (e.button == 0 /* Left button */ && (cr.isLinux || cr.isMac)) {
+ // Emulate Mac and Linux, which swallow native 'mousedown' events
+ // that close menus.
e.preventDefault();
e.stopPropagation();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698