Skip to content

Commit

Permalink
Revert "Revert "Ignore pointer events from nested ListViews (#169680)" (
Browse files Browse the repository at this point in the history
#171027)"

This reverts commit 6d25477.
  • Loading branch information
TylerLeonhardt committed Jan 11, 2023
1 parent 89e4272 commit 06c052e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/vs/base/browser/ui/list/listWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,10 @@ export class MouseController<T> implements IDisposable {
return;
}

if (e.browserEvent.defaultPrevented) {
return;
}

const focus = e.index;

if (typeof focus === 'undefined') {
Expand All @@ -709,6 +713,7 @@ export class MouseController<T> implements IDisposable {
this.list.setSelection([focus], e.browserEvent);
}

e.browserEvent.preventDefault();
this._onPointer.fire(e);
}

Expand All @@ -721,8 +726,13 @@ export class MouseController<T> implements IDisposable {
return;
}

if (e.browserEvent.defaultPrevented) {
return;
}

const focus = this.list.getFocus();
this.list.setSelection(focus, e.browserEvent);
e.browserEvent.preventDefault();
}

private changeSelection(e: IListMouseEvent<T> | IListTouchEvent<T>): void {
Expand Down
8 changes: 8 additions & 0 deletions src/vs/base/browser/ui/tree/abstractTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1358,6 +1358,10 @@ class TreeNodeListMouseController<T, TFilterData, TRef> extends MouseController<
return;
}

if (e.browserEvent.defaultPrevented) {
return;
}

const node = e.element;

if (!node) {
Expand Down Expand Up @@ -1409,6 +1413,10 @@ class TreeNodeListMouseController<T, TFilterData, TRef> extends MouseController<
return;
}

if (e.browserEvent.defaultPrevented) {
return;
}

super.onDoubleClick(e);
}
}
Expand Down

0 comments on commit 06c052e

Please sign in to comment.