Skip to content
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

Second click on canvas makes highlight disappear #942

Open
MichiK opened this issue Sep 27, 2018 · 2 comments
Open

Second click on canvas makes highlight disappear #942

MichiK opened this issue Sep 27, 2018 · 2 comments

Comments

@MichiK
Copy link

MichiK commented Sep 27, 2018

I was fiddling around with click events to lock points that were highlighted via mouseover in place by clicking on them in synchronized graphs. This works fine so far, but I noticed a strange issue that also appears in a single graph without any special stuff:

When a user clicks somewhere on the canvas, either on the curve or on the highlighting dot or somewhere else, nothing happens on the first click. However, on the second click, either on the same spot or somewhere else on the canvas, the dots highlighting the current value at the curve(s) disappear (but the legend stays visible). However, they reappear once the user moves the mouse again. Only reloading the page helps to restore the original behaviour.

In synchronized graphs, only the dots in the graph that is clicked on disappear. Tthe rest stays visible, so I guess that it may have something to do with click event handling.

Normally, this is just a minor issue but when one messes around with the mouse events (e.g. I overwrite Dygraph.prototype.mouseMove_ and Dygraph.prototype.mouseOut_ to only do something if a flag is set that can be toggled by clicking) it becomes apparent.

The issue can be seen in Firefox and Chrome on the example graph on http://dygraphs.com/.

@laczko090
Copy link

I just faced with this issue recently, maybe it helps someone in the future. My solution was to override the clearZoomRect_ method which was called during mouse down in the default interaction model.

@mirabilos
Copy link
Collaborator

@laczko090 override how exactly? (I can reproduce the issue.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants