Skip to content

Commit a1ba0cb

Browse files
authored
force primary click on dropdowns (microsoft#153176)
fixes microsoft#151064
1 parent 3b54900 commit a1ba0cb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/vs/base/browser/ui/dropdown/dropdown.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ export class BaseDropdown extends ActionRunner {
5656

5757
for (const event of [EventType.MOUSE_DOWN, GestureEventType.Tap]) {
5858
this._register(addDisposableListener(this._label, event, e => {
59-
if (e instanceof MouseEvent && e.detail > 1) {
60-
return; // prevent multiple clicks to open multiple context menus (https://github.com/microsoft/vscode/issues/41363)
59+
if (e instanceof MouseEvent && (e.detail > 1 || e.button !== 0)) {
60+
// prevent right click trigger to allow separate context menu (https://github.com/microsoft/vscode/issues/151064)
61+
// prevent multiple clicks to open multiple context menus (https://github.com/microsoft/vscode/issues/41363)
62+
return;
6163
}
6264

6365
if (this.visible) {

0 commit comments

Comments
 (0)