Widget did not get activated even when the tab is the current one #8417
-
Hi, I can see the below warning in Chrome console, also tried the example-4 from @akosyakov and got the same warning.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
A widget should implement |
Beta Was this translation helpful? Give feedback.
-
As suggested above, you have to handle the activation manually. The following will fix the widget activation in the example: diff --git a/theia-training/src/browser/jsonschema-form-widget.tsx b/theia-training/src/browser/jsonschema-form-widget.tsx
index 74b7ca1..2e15614 100644
--- a/theia-training/src/browser/jsonschema-form-widget.tsx
+++ b/theia-training/src/browser/jsonschema-form-widget.tsx
@@ -56,5 +56,11 @@ export class JsonschemaFormWidget extends BaseWidget {
ReactDOM.render(model ? <JsonschemaFormView model={model} modelService={this.modelService} /> : null!, this.viewNode);
}
+ protected onActivateRequest(message: Message): void {
+ super.onActivateRequest(message);
+ // Set the focus on the desired HTML element.
+ this.viewNode.focus();
+ }
+
} |
Beta Was this translation helpful? Give feedback.
As suggested above, you have to handle the activation manually. The following will fix the widget activation in the example: