Chromium Code Reviews| 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); |