-
Notifications
You must be signed in to change notification settings - Fork 46.7k
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
getEventKey implementation inconsistent with DOM3 spec / Firefox implementation #2193
Comments
|
I'm not quite sure what https://github.com/facebook/react/blob/master/src/browser/ui/dom/getEventKey.js#L103 is meant to mean as the comment is not really clear to me. Does it mean In any case, if we don't want to include printable characters in the |
@Daniel15 I don't agree with holding back |
I disagree, I think we gain a baseline for expected behaviour and what can safely be relied upon. At the moment, someone could be using The whole reason people use JavaScript libraries like jQuery and MooTools is that they smooth over browser incompatibilities and provide good baseline functionality. If you write some jQuery event handling code, you can be mostly sure that it will work the same way cross-browser. React's event system should be doing the same thing and providing equal cross-browser support. |
Or if we can't do that, at least have a large warning in the help explaining that |
I tested this with latest 16 release:
|
There are some inconsistencies between
getEventKey
and the DOM3 keyboard event spec (as well as what Firefox has implemented):key
property is not correctly set for printable characters onkeydown
andkeyup
events. This works properly in Firefox, and my interpretation of the standard is that Firefox's behaviour is correct here. From the spec: If the key generates a printable character, and there exists an appropriate Unicode code point, then the KeyboardEvent.key attribute must be a string consisting of the char value of that character.Repro: Test this page in Firefox and compare the result to Chrome: http://jsfiddle.net/63ycmLhe/1/
The text was updated successfully, but these errors were encountered: