Skip to content

Commit b9ce92f

Browse files
HeyImChrisappden
andauthored
git cherry-pick escape fix to 0.63-stable branch (#722)
* Add nullability checks (#704) * Update RCTCxxBridge.mm * add nullability checks * Change key identifier from "Esc" -> "Escape" (#720) Co-authored-by: Scott Kyle <scott@appden.com>
1 parent 427d9fe commit b9ce92f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

RNTester/js/examples/KeyboardEventsExample/KeyboardEventsExample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class KeyEventExample extends React.Component<{}, State> {
5454
<View
5555
acceptsKeyboardFocus={true}
5656
enableFocusRing={true}
57-
validKeysDown={['g', 'Esc', 'Enter', 'ArrowLeft']}
57+
validKeysDown={['g', 'Escape', 'Enter', 'ArrowLeft']}
5858
onKeyDown={this.onKeyDownEvent}
5959
validKeysUp={['c', 'd']}
6060
onKeyUp={this.onKeyUpEvent}>

React/Views/RCTView.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,7 @@ - (NSString*)keyIsValid:(NSString*)key left:(BOOL)leftArrowPressed right:(BOOL)r
16881688
BOOL downArrowValidityCheck = [validKeys containsObject:downArrowPressKey] && downArrowPressed;
16891689

16901690
if (escapeKeyValidityCheck) {
1691-
keyToReturn = @"Esc";
1691+
keyToReturn = @"Escape";
16921692
} else if (enterKeyValidityCheck) {
16931693
keyToReturn = @"Enter";
16941694
} else if (leftArrowValidityCheck) {

0 commit comments

Comments
 (0)