From 2d3bd3f3efbb513081ba360605503b09b5e01957 Mon Sep 17 00:00:00 2001 From: Risheek Rajolu Date: Thu, 13 Aug 2020 23:19:05 -0400 Subject: [PATCH 1/2] Return focus after copy --- source/nodejs/adaptivecards-designer/src/card-designer.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/nodejs/adaptivecards-designer/src/card-designer.ts b/source/nodejs/adaptivecards-designer/src/card-designer.ts index ecf63a7b05..ad79a4fb67 100644 --- a/source/nodejs/adaptivecards-designer/src/card-designer.ts +++ b/source/nodejs/adaptivecards-designer/src/card-designer.ts @@ -963,10 +963,10 @@ export class CardDesigner extends Designer.DesignContext { new Clipboard( this._copyJSONButton.renderedElement, { - text: (trigger) => { - return JSON.stringify(this.getCard(), null, 4); - } - }); + text: (trigger) => JSON.stringify(this.getCard(), null, 4) + }) + .on("error", () => this._copyJSONButton.renderedElement.focus()) + .on("success", () => this._copyJSONButton.renderedElement.focus()) } // Tool palette panel From d78188f4aa301a6a0d71e95eb209c2f665cfe15a Mon Sep 17 00:00:00 2001 From: Risheek Rajolu Date: Fri, 14 Aug 2020 13:30:51 -0400 Subject: [PATCH 2/2] semicolon --- source/nodejs/adaptivecards-designer/src/card-designer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/nodejs/adaptivecards-designer/src/card-designer.ts b/source/nodejs/adaptivecards-designer/src/card-designer.ts index ad79a4fb67..a5c474bf81 100644 --- a/source/nodejs/adaptivecards-designer/src/card-designer.ts +++ b/source/nodejs/adaptivecards-designer/src/card-designer.ts @@ -966,7 +966,7 @@ export class CardDesigner extends Designer.DesignContext { text: (trigger) => JSON.stringify(this.getCard(), null, 4) }) .on("error", () => this._copyJSONButton.renderedElement.focus()) - .on("success", () => this._copyJSONButton.renderedElement.focus()) + .on("success", () => this._copyJSONButton.renderedElement.focus()); } // Tool palette panel