From 07d6f5b35fac559504dec65e3073d796b2d25a55 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Wed, 25 Jan 2023 19:04:13 -0800 Subject: [PATCH] Revert "fixes #170559 (#170567)" (#172491) This reverts commit fb26225367cf62e11d65982c4718186de49c1000. --- .../base/parts/quickinput/browser/quickInputList.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/vs/base/parts/quickinput/browser/quickInputList.ts b/src/vs/base/parts/quickinput/browser/quickInputList.ts index eab1fcdd93471..910dda8ba3d39 100644 --- a/src/vs/base/parts/quickinput/browser/quickInputList.ts +++ b/src/vs/base/parts/quickinput/browser/quickInputList.ts @@ -119,6 +119,11 @@ class ListElementRenderer implements IListRenderer { + if (!data.checkbox.offsetParent) { // If checkbox not visible: + e.preventDefault(); // Prevent toggle of checkbox when it is immediately shown afterwards. #91740 + } + })); data.checkbox = dom.append(label, $('input.quick-input-list-checkbox')); data.checkbox.type = 'checkbox'; data.toDisposeTemplate.push(dom.addStandardDisposableListener(data.checkbox, dom.EventType.CHANGE, e => { @@ -350,6 +355,12 @@ export class QuickInputList { this._onKeyDown.fire(event); })); + this.disposables.push(this.list.onMouseDown(e => { + if (e.browserEvent.button !== 2) { + // Works around / fixes #64350. + e.browserEvent.preventDefault(); + } + })); this.disposables.push(dom.addDisposableListener(this.container, dom.EventType.CLICK, e => { if (e.x || e.y) { // Avoid 'click' triggered by 'space' on checkbox. this._onLeave.fire();