mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-21 11:15:36 -05:00
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:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user