React: Why is onDoubleClick not named onDblClick?

Created on 19 May 2016  路  13Comments  路  Source: facebook/react

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

starter

Most helpful comment

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.

All 13 comments

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.

ok :/

Leaving the issue open to track adding a warning.

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

Is this ready for someone to work on now?

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

Cool beans. I'll take a look

Ok, opened https://github.com/facebook/react/pull/6881
Let me know if there's a better way to do this.

Fixed in #6881

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

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

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

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!

Was this page helpful?
0 / 5 - 0 ratings