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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/DropDownMenu.js

Issue 2718623002: DevTools: remove selections on dropdown menu open
Patch Set: Created 3 years, 10 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: third_party/WebKit/Source/devtools/front_end/ui/DropDownMenu.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/DropDownMenu.js b/third_party/WebKit/Source/devtools/front_end/ui/DropDownMenu.js
index 9ee2469e8601c1b175b72bf0f47124dc95cc8f26..f9a464d03fe710a2d58dc0766bc7e7c7cff714c7 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/DropDownMenu.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/DropDownMenu.js
@@ -22,6 +22,11 @@ UI.DropDownMenu = class extends Common.Object {
_onMouseDown(event) {
if (event.which !== 1)
return;
+
+ // Remove any selections to avoid native context menu items, for example 'Copy'.
+ var selection = UI.inspectorView.element.window().getSelection();
lushnikov 2017/03/03 04:11:00 it would be nice if we can create context menus wi
+ selection.removeAllRanges();
+
var menu = new UI.ContextMenu(event);
for (var item of this._items)
menu.appendCheckboxItem(item.title, this._itemHandler.bind(this, item.id), item.id === this._selectedItemId);
« 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