plotly / plotly/plotly.js

Click events stop firing after slow "double" click (when using beforehover event handler)

Open
#6,582 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug P2
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.