dillon1000/react

Commit

Use KeyboardEvent.char in the fallback logic if available (#9792)

When a user types an emoji via Touch keyboard in IE, React's fallback logic
creates the `BeforeInput` event based on the `keypress`.  However, the length
of an emoji character (e.g. `\uD83D\uDE0A`) is two, so the `which` property
does not represent an emoji correctly.

Because IE's KeyboardEvent has the `char` property holding an entire emoji,
we can use it directly instead of converting from the `which`.
Browse files
Changed paths2 files
First-parent comparison
M src/renderers/dom/shared/eventPlugins/BeforeInputEventPlugin.js ModifiedM src/renderers/dom/shared/eventPlugins/__tests__/BeforeInputEventPlugin-test.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…