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

Why is onDoubleClick not named onDblClick? #6809

Closed
caub opened this issue May 19, 2016 · 13 comments
Closed

Why is onDoubleClick not named onDblClick? #6809

caub opened this issue May 19, 2016 · 13 comments

Comments

@caub
Copy link

caub commented May 19, 2016

the DOM event is dblclick, why having diverged from it? it adds more confusion in my opinion. DblClick was maybe badly named, but all the other react events follows the DOM counterpart, it makes it really easier to stick to the original names

@jimfb
Copy link
Contributor

jimfb commented May 23, 2016

Personally, I agree, it is confusing. But onDoubleClick is a "better" name, so the decision was made to use it.

We should probably add a warning so people aren't confused.

@caub
Copy link
Author

caub commented May 23, 2016

ok :/

@caub caub closed this as completed May 23, 2016
@jimfb jimfb reopened this May 23, 2016
@jimfb
Copy link
Contributor

jimfb commented May 23, 2016

Leaving the issue open to track adding a warning.

@keyz keyz assigned keyz and jimfb and unassigned keyz and jimfb May 24, 2016
@keyz
Copy link
Contributor

keyz commented May 24, 2016

Let's wait until #6800 merges since new changes might break.

@natenorberg
Copy link
Contributor

Is this ready for someone to work on now?

@gaearon
Copy link
Collaborator

gaearon commented May 25, 2016

@natenorberg As far as I can see, you can take it!

@natenorberg
Copy link
Contributor

Cool beans. I'll take a look

@natenorberg
Copy link
Contributor

Ok, opened #6881
Let me know if there's a better way to do this.

@jimfb
Copy link
Contributor

jimfb commented May 27, 2016

Fixed in #6881

@zeegeek
Copy link

zeegeek commented Oct 23, 2017

I face that the onDoubleClick event doesn't work in IOS device it works well in android but in Iphone it doesn't work, I have also added cursor:'pointer' but still no luck. What could be the issue here

@P1zz4br0etch3n
Copy link

P1zz4br0etch3n commented Aug 20, 2018

Really? A "better" name is the reason?
What about compatibility to other js libraries which automatically add dblclick events like d3-zoom? I can't use the doubleclick zoom because react doesn't allow the property 'dblclick' on a <svg> tag...

@gaearon
Copy link
Collaborator

gaearon commented Aug 21, 2018

@P1zz4br0etch3n I think you might be confused by something. Whether React uses a specific event name or not has nothing to do with what a d3 library would do. React uses event delegation for better performance so it doesn't literally attach event listeners to every node anyway. If you file a new issue with a runnable code example that demonstrates your problem I'd be happy to look into it.

@facebook facebook locked as off-topic and limited conversation to collaborators Aug 21, 2018
@gaearon
Copy link
Collaborator

gaearon commented Aug 21, 2018

Locking this to prevent further confusion. If you are experiencing some problem related to this please file a new issue with a runnable code example that we can discuss. Thanks!

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

No branches or pull requests

7 participants