Title: [MNT]: Draggable legend gets stuck on cursor after scroll event · Issue #29142 · matplotlib/matplotlib · GitHub
Open Graph Title: [MNT]: Draggable legend gets stuck on cursor after scroll event · Issue #29142 · matplotlib/matplotlib
X Title: [MNT]: Draggable legend gets stuck on cursor after scroll event · Issue #29142 · matplotlib/matplotlib
Description: Summary Draggable legend gets stuck to cursor after scrolling while hovering the artist. To 'unstick' it, it is necessary to left click. I believe the expected behavior is to only drag the legend while holding the left mouse button. If t...
Open Graph Description: Summary Draggable legend gets stuck to cursor after scrolling while hovering the artist. To 'unstick' it, it is necessary to left click. I believe the expected behavior is to only drag the legend w...
X Description: Summary Draggable legend gets stuck to cursor after scrolling while hovering the artist. To 'unstick' it, it is necessary to left click. I believe the expected behavior is to only drag the ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/29142
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[MNT]: Draggable legend gets stuck on cursor after scroll event","articleBody":"### Summary\n\nDraggable legend gets stuck to cursor after scrolling while hovering the artist. To 'unstick' it, it is necessary to left click. I believe the expected behavior is to only drag the legend while holding the left mouse button. If that is not the case, please close this issue.\n\n### Proposed fix\n\nSample code:\r\n```python\r\nimport matplotlib.pyplot as plt\r\n\r\nplt.plot([],[], label='scroll over me, then move the cursor')\r\nplt.legend(draggable=True)\r\nplt.show()\r\n```\r\n\r\nI believe the issue is that the class `DraggableBase` (at line 1425 of matplotlib/offsetbox.py) uses a 'pick' event to grab the artist, which I believe includes scrolling events. It might be possible to return from a false positive pick by checking that the pick event is a mouse click instead of scrolling at `DraggableBase.on_pick`. Another alternative is to change the pick event to a `button_press` event.","author":{"url":"https://github.com/p479h","@type":"Person","name":"p479h"},"datePublished":"2024-11-14T16:58:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/29142/matplotlib/issues/29142"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fcd24124-4f19-14a6-2a2e-9727524b7336 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A6CE:1694AE:360045:4937D5:6A51BFC9 |
| html-safe-nonce | a95266d10a52d2a30df85eee767ddf20b45d5b26e4ca78a48ee5dca96846a7e4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNkNFOjE2OTRBRTozNjAwNDU6NDkzN0Q1OjZBNTFCRkM5IiwidmlzaXRvcl9pZCI6IjcyNjk3MDI4OTE1NjQyODU4OTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 682161bc202e0e82403a48fc9546c07f9b503813ece3d289ac335fac4b2ff406 |
| hovercard-subject-tag | issue:2659468426 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/29142/issue_layout |
| twitter:image | https://opengraph.githubassets.com/12c0fbf45dd0cde51e7a94b054ec6b9d376f9301d09236c02acb68b6a98c4e72/matplotlib/matplotlib/issues/29142 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/12c0fbf45dd0cde51e7a94b054ec6b9d376f9301d09236c02acb68b6a98c4e72/matplotlib/matplotlib/issues/29142 |
| og:image:alt | Summary Draggable legend gets stuck to cursor after scrolling while hovering the artist. To 'unstick' it, it is necessary to left click. I believe the expected behavior is to only drag the legend w... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | p479h |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width