Skip to content

Commit

Permalink
[Fix] Webview is not focused after cancelling quick open widget
Browse files Browse the repository at this point in the history
Signed-off-by: Shahar Harari <shahar.harari@sap.com>
  • Loading branch information
shahar-h committed Jul 5, 2020
1 parent 7a88d28 commit a48cd94
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/plugin-ext/src/main/browser/webview/webview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,15 @@ export class WebviewWidget extends BaseWidget implements StatefulWidget {
this.toDisposeOnDetach.push(Disposable.create(() => this.forceHide()));
}

protected onAfterAttach(msg: Message): void {
super.onAfterAttach(msg);
this.node.addEventListener('focus', () => {
if (this.element) {
this.doSend('focus');
}
});
}

protected onBeforeShow(msg: Message): void {
super.onBeforeShow(msg);
this.doShow();
Expand Down Expand Up @@ -376,14 +385,7 @@ export class WebviewWidget extends BaseWidget implements StatefulWidget {

protected onActivateRequest(msg: Message): void {
super.onActivateRequest(msg);
this.focus();
}

focus(): void {
this.node.focus();
if (this.element) {
this.doSend('focus');
}
}

reload(): void {
Expand Down

0 comments on commit a48cd94

Please sign in to comment.