Skip to content

plotly_clickannotation event not firing on editable: true #1750

Description

@marcusblevin

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

Activity

  1. etpinard commented on May 31, 2017

    @etpinard
    Contributor

    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.

  2. marcusblevin commented on Jun 1, 2017

    @marcusblevin
    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.

  3. etpinard commented on Jun 1, 2017

    @etpinard
    Contributor

    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.

  4. marcusblevin commented on Jun 1, 2017

    @marcusblevin
    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.

  5. etpinard commented on Jun 1, 2017

    @etpinard
    Contributor

    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.

  6. changed the title [-]plotly_clickannotation event not firing[/-] [+]plotly_clickannotation event not firing on `editable: true`[/+] on Jun 1, 2017
  7. slfan2013 commented on Jun 20, 2019

    @slfan2013

    Hi @etpinard, is there any update on this?

    thanks.

  8. self-assigned this
    on Jun 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugsomething broken

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions