Skip to content

plotly_clickannotation event not firing on editable: true #1750

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
marcusblevin opened this issue May 31, 2017 · 6 comments · Fixed by #3979
Closed

plotly_clickannotation event not firing on editable: true #1750

marcusblevin opened this issue May 31, 2017 · 6 comments · Fixed by #3979
Assignees
Labels
bug something broken

Comments

@marcusblevin
Copy link

Has something changed with the plotly_clickannotation event? I have tried reverting back to a previous version (1.22.0) and the event is firing but on latest (1.27.0) it is not.

See CodePen for example using latest version

@etpinard
Copy link
Contributor

etpinard commented May 31, 2017

We apologise if your graphs are currently broken, adding captureevents: true to your annotation settings should do the trick - as in https://codepen.io/etpinard/pen/PmMxZL?editors=0011

See

for more details on the issue.

@marcusblevin
Copy link
Author

Thank you, that fixes the issue with the event firing but is that event dependent upon the editable configuration option not being turned on? I saw you had it disabled in the Codepen. The use case I am trying to accomplish is allow the annotation to be moved and capture the click event to load the currently set properties into an editor the user can use to update the annotation. Seems like this is a one or the other solution.

@etpinard
Copy link
Contributor

etpinard commented Jun 1, 2017

but is that event dependent upon the editable configuration option not being turned on?

Yeah. I noticed that too. I'm not sure if on purpose and/or the desired behavior.

The use case I am trying to accomplish is allow the annotation to be moved and capture the click event to load the currently set properties into an editor the user can use to update the annotation

You should listen to plotly_relayout instead to accomplish this task.

@marcusblevin
Copy link
Author

To be more specific, I use the plotly_clickannotation event to load the properties into the editor and to immediately change the focus so the text in the annotation never shows as editable and the edits instead happen in the form inputs. Plotly_relayout would fire after a change to the plot occurs but I want the event to be captured before any changes are made. Granted I could use plotly_relayout to capture the info when the annotation is moved but the loading of the inputs should not be dependent upon the annotation being repositioned.

@etpinard
Copy link
Contributor

etpinard commented Jun 1, 2017

to immediately change the focus so the text in the annotation never shows as editable and the edits instead happen in the form inputs.

That's an interesting use case, probably not what we envision plotly_clickannotation to be for, but interesting nonetheless.


After thinking about this a little bit longer, I'm going to call this a bug: plotly_clickannotation and, more generally, all plotly_ events, should be triggered in editable: true mode.

Changing the issue title accordingly.

@etpinard etpinard changed the title plotly_clickannotation event not firing plotly_clickannotation event not firing on editable: true Jun 1, 2017
@etpinard etpinard added the bug something broken label Jun 1, 2017
@slfan2013
Copy link

Hi @etpinard, is there any update on this?

thanks.

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

Successfully merging a pull request may close this issue.

3 participants