Skip to content

Unhover does not fire when drag triggers unhover #5437

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
rreusser opened this issue Jan 22, 2021 · 0 comments · Fixed by #5407
Closed

Unhover does not fire when drag triggers unhover #5437

rreusser opened this issue Jan 22, 2021 · 0 comments · Fixed by #5407
Labels
bug something broken

Comments

@rreusser
Copy link
Contributor

To aid hooking up external behavior on hover/unhover, there is a small inconvenience with plotly_unhover not being fired when dragging triggers unhover.

Version: Plotly 1.58.4
Browser: Chrome 88.0.4324.96 (Official Build) (x86_64)
Platform: Mac OS X 10.13.6

var Plotly = require('plotly.js');
var gd = document.createElement('div');
document.body.appendChild(gd);

Plotly.plot(gd, [{ x: [1, 2, 3], y: [4, 2, 1] }]);

gd.on('plotly_unhover', function () {
    console.log('unhover!');
});

The gif below illustrates the issue. In particular, when dragging to zoom begins, the console.log counter from previous unhovers is at 3. The hover disappears, the zooming completes, but plotly_unhover count remains at 3 until a new hover is created and then unhovered once more.

In other words, the unhover which should result from unhovering when dragging is completely missed, making it more inconvenient to use hover/unhover to interpret what the hover state ought to be.

hoverissue

Notes:

  • I removed hovermode:closest from the js code above, though the gif did have that enabled. I confirmed it has no effect but didn't recreate the gif.
  • Fire unhover when dragging plot #5407 will fix this issue and will be complete once a test is added for this case
@archmoj archmoj added the bug something broken label Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants