From 10da7d1b090a1e09876f54c6bc059cefada82569 Mon Sep 17 00:00:00 2001 From: Raymond Zhao Date: Mon, 7 Feb 2022 11:59:14 -0800 Subject: [PATCH] Fix #142421 POINTER_DOWN was stealing too many events. The old event handlers handled events such as MOUSE_UP, and it turns out we can just use POINTER_UP instead. --- src/vs/base/browser/ui/selectBox/selectBoxCustom.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/vs/base/browser/ui/selectBox/selectBoxCustom.ts b/src/vs/base/browser/ui/selectBox/selectBoxCustom.ts index 90f20648564c1..f1a181ca65098 100644 --- a/src/vs/base/browser/ui/selectBox/selectBoxCustom.ts +++ b/src/vs/base/browser/ui/selectBox/selectBoxCustom.ts @@ -777,8 +777,7 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi this._register(onSelectDropDownKeyDown.filter(e => (e.keyCode >= KeyCode.Digit0 && e.keyCode <= KeyCode.KeyZ) || (e.keyCode >= KeyCode.Semicolon && e.keyCode <= KeyCode.NumpadDivide)).on(this.onCharacter, this)); // SetUp list mouse controller - control navigation, disabled items, focus - - this._register(dom.addDisposableListener(this.selectList.getHTMLElement(), dom.EventType.POINTER_DOWN, e => this.onPointerDown(e))); + this._register(dom.addDisposableListener(this.selectList.getHTMLElement(), dom.EventType.POINTER_UP, e => this.onPointerUp(e))); this._register(this.selectList.onMouseOver(e => typeof e.index !== 'undefined' && this.selectList.setFocus([e.index]))); this._register(this.selectList.onDidChangeFocus(e => this.onListFocus(e))); @@ -800,7 +799,7 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi // List mouse controller - active exit, select option, fire onDidSelect if change, return focus to parent select // Also takes in touchend events - private onPointerDown(e: PointerEvent): void { + private onPointerUp(e: PointerEvent): void { if (!this.selectList.length) { return; @@ -814,7 +813,7 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi } // Check our mouse event is on an option (not scrollbar) - if (!!target.classList.contains('slider')) { + if (target.classList.contains('slider')) { return; }