Fix extensions regression bug (#489)

* add output div visibility rule and make sure CustomWidget is being registered

* add new runAfterRuntimeInitialized method that classes can use to run code only after runtime actually initialized

* replace setTimout with proper event to wait for runtime to be completed

* replace setTimout on pyinpytbox with proper event to wait for runtime to be completed
This commit is contained in:
Fabio Pliger
2022-06-01 22:39:05 +02:00
committed by GitHub
parent d6a88d4c9e
commit f60dd6a788
3 changed files with 16 additions and 4 deletions

View File

@@ -65,11 +65,11 @@ export class PyButton extends BaseEvalElement {
// now that we appended and the element is attached, lets connect with the event handlers
// defined for this widget
setTimeout(async () => {
this.runAfterRuntimeInitialized(async () => {
await this.eval(this.code);
await this.eval(registrationCode);
console.log('registered handlers');
}, 4000);
});
console.log('py-button connected');
}