mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 10:15:41 +00:00
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.
This commit is contained in:
parent
09d3d16f98
commit
10da7d1b09
1 changed files with 3 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue