Skip to content

in version 1.4 onclick event broken #173

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
arnaudcol opened this issue Jan 11, 2016 · 9 comments
Closed

in version 1.4 onclick event broken #173

arnaudcol opened this issue Jan 11, 2016 · 9 comments
Labels
bug something broken

Comments

@arnaudcol
Copy link

No description provided.

@etpinard
Copy link
Contributor

Bug confirmed (for all traces but pies, it looks like). Working on a fix now.

@etpinard etpinard added the bug something broken label Jan 11, 2016
@etpinard
Copy link
Contributor

Click events are working in v1.3.1 http://cdn.plot.ly/plotly-1.3.1.min.js

@etpinard
Copy link
Contributor

@alexcjohnson commenting out fx.unhover in the dragBox definition makes click events work again.

Why did you put this in b1a1c24 ?

@etpinard
Copy link
Contributor

Right. We need to clear the hover labels when starting a selection. Let's see if there's a way to make that happen on click events.

@alexcjohnson
Copy link
Collaborator

Ah, nuts.

Right. We need to clear the hover labels when starting a selection.

bingo. It's nice there because that clears hover labels on ANY drag event... select, zoom, pan... but I guess the solution would be to wait until dragged is true (which gets plugged into gd._dragged, though at this point that's only used within the fx.dragElement closure so could and should be ditched in favor of a local var). I suppose either we could say hover effects should always clear when you're dragging, no matter what it is you're dragging... then we could put the fx.unhover call right there in fx.dragElement next to gd._dragged = true;. If you don't feel comfortable with that in all cases, we could add an options.draggedFn (these should really be called options.onDragged etc shouldn't they...) to be called there.

@etpinard
Copy link
Contributor

I suppose either we could say hover effects should always clear when you're dragging, no matter what it is you're dragging...

@alexcjohnson Could you give me examples of things that can be dragged ?

@alexcjohnson
Copy link
Collaborator

dhcp159:plotlyjs alex$ ag dragElement
src/components/annotations/index.js
586:                Plotly.Fx.dragElement({
644:            Plotly.Fx.dragElement({

src/components/colorbar/draw.js
458:            Plotly.Fx.dragElement({

src/components/legend/index.js
531:        Plotly.Fx.dragElement({

src/plots/cartesian/graph_interact.js
1412:    fx.dragElement(dragOptions);
1992:fx.dragElement = function(options) {

@alexcjohnson
Copy link
Collaborator

I think this is OK - fx.unhover works fine when there's no hover to begin with, and in all of those cases if for whatever reason there DID happen to be some hovertext that didn't get cleared, it would be nice to do so!

@etpinard
Copy link
Contributor

@alexcjohnson thanks.

I'd vote for clearing all hover effects upon dragged. I don't see the need to add logic for annotations, legend and colorbar dragging - at least for now.

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

3 participants