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); } }