Closed
Description
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.
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