Skip to content

Commit

Permalink
Fix extension manager single-click (microsoft#10473)
Browse files Browse the repository at this point in the history
* Fix extension manager single-click

* Port over additional change to fix same issue in git viewlet

* Remove unneeded param to match vscode source
  • Loading branch information
kburtram authored May 18, 2020
1 parent 12ee132 commit d60b094
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/vs/platform/list/browser/listService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,6 @@ abstract class ResourceNavigator<T> extends Disposable {
onDidChangeFocus: Event<{ browserEvent?: UIEvent }>,
onDidChangeSelection: Event<{ browserEvent?: UIEvent }>,
onDidOpen: Event<{ browserEvent?: UIEvent }>,
readonly openOnSingleClick?: boolean
},
options?: IResourceNavigatorOptions
) {
Expand Down Expand Up @@ -712,7 +711,7 @@ abstract class ResourceNavigator<T> extends Disposable {
!!(<SelectionKeyboardEvent>browserEvent).preserveFocus :
!isDoubleClick;

if (this.treeOrList.openOnSingleClick || isDoubleClick || isKeyboardEvent) {
if (this.options.openOnSingleClick || isDoubleClick || isKeyboardEvent) {
const sideBySide = browserEvent instanceof MouseEvent && (browserEvent.ctrlKey || browserEvent.metaKey || browserEvent.altKey);
this.open(preserveFocus, isDoubleClick || isMiddleClick, sideBySide, browserEvent);
}
Expand All @@ -739,8 +738,8 @@ export class ListResourceNavigator<T> extends ResourceNavigator<number> {
}

export class TreeResourceNavigator<T, TFilterData> extends ResourceNavigator<T> {
constructor(tree: WorkbenchObjectTree<T, TFilterData> | WorkbenchCompressibleObjectTree<T, TFilterData> | WorkbenchDataTree<any, T, TFilterData> | WorkbenchAsyncDataTree<any, T, TFilterData> | WorkbenchCompressibleAsyncDataTree<any, T, TFilterData>, options: IResourceNavigatorOptions = {}) {
super(tree, options);
constructor(tree: WorkbenchObjectTree<T, TFilterData> | WorkbenchCompressibleObjectTree<T, TFilterData> | WorkbenchDataTree<any, T, TFilterData> | WorkbenchAsyncDataTree<any, T, TFilterData> | WorkbenchCompressibleAsyncDataTree<any, T, TFilterData>, options?: IResourceNavigatorOptions) {
super(tree, { openOnSingleClick: tree.openOnSingleClick, ...(options || {}) });
}
}

Expand Down

0 comments on commit d60b094

Please sign in to comment.