Click events stop firing after slow "double" click (when using beforehover event handler)
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 18.3k
- Forks
- 2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 28
Description
Hello,
I'm using the plotly_click and plotly_beforehover events to get the hover label to persist when someone clicks on a data point.
The idea is that after someone clicks a store a reference to the point they've clicked on. Then in the before hover event, if that reference is populated I cancel the hover event.
(I'm doing more than this in the actual code, but this represents the problem).
If you click quite fast, not fast enough to register as a double click, but pretty quickly, as you move the mouse around. Then sometimes that causes the click events to stop being fired.
This seems to happen when there is a point that should have a persistent hover. The hover gets turned off but then no other hovers are displayed. The reference is populated but the user can't click to turn it off. So you get stuck with no hover labels showing up.
Here's a demo: https://jsfiddle.net/mdt6rqck/
It feels like the quick clicking causes some kind of hover state to get stuck? So now the click events can't get through?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the stuck-hover behavior using the linked JSFiddle, focusing on rapid clicks that are slower than a double click and the plotly_click and plotly_beforehover handlers. Trace the hover and click event entry points to identify why later clicks are suppressed; done means persistent hover labels can be cleared and subsequent clicks continue firing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100