-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Labels
status: confirmed bugstatus: has patchpatch suggested, PR still neededpatch suggested, PR still needed
Milestone
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 that is not the case, please close this issue.
Proposed fix
Sample code:
import matplotlib.pyplot as plt
plt.plot([],[], label='scroll over me, then move the cursor')
plt.legend(draggable=True)
plt.show()
I 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.
Metadata
Metadata
Assignees
Labels
status: confirmed bugstatus: has patchpatch suggested, PR still neededpatch suggested, PR still needed