Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a dispose method to IJupyterYWidget #20

Merged
merged 2 commits into from
Feb 6, 2025

Conversation

brichet
Copy link
Member

@brichet brichet commented Feb 6, 2025

Call a 'dispose()' method of the widget when the view is disposed (notebook closed or cell output cleared).

cc. @trungleduc

@brichet
Copy link
Member Author

brichet commented Feb 6, 2025

For the context, it has been discussed at geojupyter/jupytergis#419 (comment)

@@ -22,6 +23,7 @@ export class JupyterYWidget extends Widget implements IRenderMime.IRenderer {
}

dispose(): void {
this._ywidget?.dispose?.();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be called later, after the this.isDisposed check?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I first tried after the this._yModel?.dispose(); but it was never reached in our case (jupytergis). I missed the error below.
I'll check if this is related to jupytergis or yjs_widgets.

@martinRenou martinRenou added the bug Something isn't working label Feb 6, 2025
@trungleduc
Copy link
Member

Thanks!

@trungleduc
Copy link
Member

I don't have the right to merge 😃

@brichet
Copy link
Member Author

brichet commented Feb 6, 2025

I don't have the right to merge 😃

😄 does somebody has this right ??

@trungleduc
Copy link
Member

Copy link
Member

@davidbrochart davidbrochart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@davidbrochart davidbrochart merged commit e181feb into QuantStack:main Feb 6, 2025
2 checks passed
@brichet brichet deleted the dispose_widget branch February 6, 2025 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants