Thanks to visit codestin.com
Credit goes to github.com

Skip to content

key name change 'buttons'->'button' #29600

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

Closed
wants to merge 1 commit into from

Conversation

bjmuldre-intc
Copy link

KeyError raised by ipympl resolved by this change. Restores interactive functionality in notebooks

PR summary

use of Ipympl in notebook raised KeyError. Changing "buttons">>"button" resolves the issue

PR checklist

Example of error:

image

Example after commit:

image

KeyError raised by `ipympl` resolved by this change. Restores interactive functionality in notebooks
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on gitter for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide

We strive to be a welcoming and open project. Please follow our Code of Conduct.

Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, however I believe the suggestion is not correct. There is indeed a buttons property on MouseEvents (https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons), and from the masking above it's quite clear that this is meant.

The question should rather be: Why is the property not there? Please debug event['type'] to see which event you are processing. Also, can you please provide a minimal example so that we can inspect the underlying issue.

@QuLogic
Copy link
Member

QuLogic commented Feb 11, 2025

This was already reported in #29337, and fixed in matplotlib/ipympl#568, which was released in ipympl 0.9.5. Please update your packages.

@QuLogic QuLogic closed this Feb 11, 2025
@bjmuldre-intc
Copy link
Author

This was already reported in #29337, and fixed in matplotlib/ipympl#568, which was released in ipympl 0.9.5. Please update your packages.

Yes, I saw others had similar issues that were resolved with ipympl==0.9.5 so that was the first thing I did. I am on the latest versions of both matplotlib and ipympl and still having the issue, however.

@bjmuldre-intc
Copy link
Author

@timhoffm Thanks for your interest and for re-framing the question. It appears to be a bug in VSCod(ium). Issue does not appear in vanilla jupyter lab server

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

Successfully merging this pull request may close these issues.

3 participants