From c67a66c6ff9d8c0ea0a0bf8552ef62997e89186e Mon Sep 17 00:00:00 2001 From: Alan Ren Date: Mon, 16 Aug 2021 13:31:06 -0700 Subject: [PATCH] only handle connection profile (#16790) --- .../connection/browser/connectionDialogWidget.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/sql/workbench/services/connection/browser/connectionDialogWidget.ts b/src/sql/workbench/services/connection/browser/connectionDialogWidget.ts index 9d66ee2d1a..df9cdff07a 100644 --- a/src/sql/workbench/services/connection/browser/connectionDialogWidget.ts +++ b/src/sql/workbench/services/connection/browser/connectionDialogWidget.ts @@ -318,10 +318,12 @@ export class ConnectionDialogWidget extends Modal { const divContainer = DOM.append(recentConnectionContainer, DOM.$('.server-explorer-viewlet')); const treeContainer = DOM.append(divContainer, DOM.$('.explorer-servers')); const leftClick = (element: any, eventish: ICancelableEvent, origin: string) => { - // element will be a server group if the tree is clicked rather than a item - const isDoubleClick = origin === 'mouse' && (eventish as MouseEvent).detail === 2; - this._connectionSource = 'recent'; - this.onConnectionClick(element, isDoubleClick); + // element will be a server group if the blank area of the tree is clicked, we should only proceed is a connection profile is selected. + if (element instanceof ConnectionProfile) { + const isDoubleClick = origin === 'mouse' && (eventish as MouseEvent).detail === 2; + this._connectionSource = 'recent'; + this.onConnectionClick(element, isDoubleClick); + } }; const actionProvider = this.instantiationService.createInstance(RecentConnectionActionsProvider); const controller = new RecentConnectionTreeController(leftClick, actionProvider, this.connectionManagementService, this.contextMenuService);