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

Frontend's _dragging is not recognized by the backend and fails set_state() #995

Closed
xiaochen-db opened this issue Jun 14, 2022 · 3 comments · Fixed by #997
Closed

Frontend's _dragging is not recognized by the backend and fails set_state() #995

xiaochen-db opened this issue Jun 14, 2022 · 3 comments · Fixed by #997

Comments

@xiaochen-db
Copy link
Contributor

Field _dragging was added to frontend's LeafletMapModel at #339, however it's not found by the Python backend during set_state(), and thus throws traitlets.traitlets.TraitError: Class Map does not have a trait named _dragging.

Note that this can only be reproduced when env var JUPYTER_WIDGETS_ECHO is set to true.

Looking at where _dragging is used, it seems to be only within the frontend. Can we change it to an attribute rather than the current model field, so that it won't be synced to the backend?

@xiaochen-db
Copy link
Contributor Author

Also this jupyter-widgets/ipywidgets@eddfdc6 has been merged to ipywidgets so that during set_state() _dragging from the sync message can be ignored (because it's not a field to sync in class Map). But still it's worth not sending _dragging to Python at the first place

@jasongrout
Copy link
Member

Can we change it to an attribute rather than the current model field, so that it won't be synced to the backend?

That was actually a suggestion on the original ticket that was never implemented. +1 to changing the model _dragging value to a view this._dragging attribute.

@jasongrout
Copy link
Member

Note that this bug means that ipyleaflet is broken in ipywidgets 7.7.0 when the widget echo is turned on, and is also broken in master currently. We're fixing ipywidgets to be more lenient, but as @xiaochen-db says, i think it is good to fix it here too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants