Skip to content

plotly_legenddoubleclick never fires if plotly_legendclick return false #5350

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
mmakrzem opened this issue Dec 17, 2020 · 4 comments
Closed
Labels
bug something broken

Comments

@mmakrzem
Copy link

I would like to wire my own event handling when the legend is single clicked or double clicked.

I created the following demo: https://codepen.io/mmakrzem/pen/wvzdVaM

Notice that only the plotly_legendclick event triggers when I single or double click in the legend. The plotly_legenddoubleclick event never fires (because the plotly_legendclick is returning false).

If I double click I also wouldn't expect the plotly_legendclick event to fire.

@ttrinidad
Copy link

There is a timer there that tries to debounce it, here: https://github.com/plotly/plotly.js/blob/master/src/components/legend/draw.js#L371

It seems the default should be 300ms (https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js#L171), but you can try changing it through config.doubleClickDelay

@mollybsmith-noaa
Copy link

I'm also experiencing this behavior (plotly_legenddoubleclick never fires if there's a custom handler for plotly_legendclick), and I don't think it's related to the double click delay, as I set that to 5 seconds and the problem persisted.

andrej-vasilj added a commit to andrej-vasilj/plotly.js that referenced this issue Sep 15, 2023
@archmoj archmoj added the bug something broken label Sep 22, 2023
archmoj added a commit that referenced this issue Sep 22, 2023
Fixing issue #5350 by moving the 'false' check
@archmoj
Copy link
Contributor

archmoj commented Sep 22, 2023

Fixed by #6727.

@archmoj archmoj closed this as completed Sep 22, 2023
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

No branches or pull requests

4 participants