From 9ca17dbe7fda918f978f6ff6eb3eae4235123665 Mon Sep 17 00:00:00 2001 From: Alan Ren Date: Mon, 8 Jun 2020 11:48:50 -0700 Subject: [PATCH] fix button column click issue (#10788) --- .../base/browser/ui/table/plugins/buttonColumn.plugin.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/sql/base/browser/ui/table/plugins/buttonColumn.plugin.ts b/src/sql/base/browser/ui/table/plugins/buttonColumn.plugin.ts index 2631b2d303..ce94de1ffc 100644 --- a/src/sql/base/browser/ui/table/plugins/buttonColumn.plugin.ts +++ b/src/sql/base/browser/ui/table/plugins/buttonColumn.plugin.ts @@ -66,8 +66,13 @@ export class ButtonColumn implements Slick.Plugin private handleClick(args: Slick.OnClickEventArgs): void { if (this.isCurrentColumn(args.cell)) { - this._grid.setActiveCell(args.row, args.cell); - this.fireClickEvent(); + // SlickGrid will automatically set active cell on mouse click event, + // during the process of setting active cell, blur event will be triggered and handled in a setTimeout block, + // on Windows platform, the context menu is html based which will respond the focus related events and hide the context menu. + // If we call the fireClickEvent directly the menu will be set to hidden immediately, to workaround the issue we need to wrap it in a setTimeout block. + setTimeout(() => { + this.fireClickEvent(); + }, 0); } }