Skip to content

Commit

Permalink
makes comment more descriptive as to affected platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
nstraub committed Nov 22, 2017
1 parent b8a0c44 commit 943d589
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/react-dom/src/events/getEventCharCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ function getEventCharCode(nativeEvent) {
charCode = keyCode;
}

// Chrome, IE 11 and Edge report Enter as charCode 10 when ctrl is pressed.
// IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux)
// report Enter as charCode 10 when ctrl is pressed.
if (charCode === 10) {
charCode = 13;
}

// Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
// Must not discard the (non-)printable Enter-key.
if (charCode >= 32 || charCode === 13) {
Expand Down

0 comments on commit 943d589

Please sign in to comment.