Skip to content

Commit e566c1e

Browse files
sbuggayfacebook-github-bot
authored andcommitted
Implement escape/cancel key press callback for TextInput (#48680)
Summary: Pull Request resolved: #48680 ## Changelog: [General] [Added] - Adds the escape key to the key press event handler payload. Reviewed By: shwanton Differential Revision: D68186072 fbshipit-source-id: 01786c309bff4991c12fa667e933ff6105efe638
1 parent c89c5d7 commit e566c1e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/react-native/ReactCommon/react/renderer/components/textinput/TextInputEventEmitter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ static jsi::Value keyPressMetricsPayload(
119119
key = "Enter";
120120
} else if (keyPressMetrics.text.front() == '\t') {
121121
key = "Tab";
122+
} else if (keyPressMetrics.text.front() == '\x1B') {
123+
key = "Escape";
122124
} else {
123125
key = keyPressMetrics.text;
124126
}

0 commit comments

Comments
 (0)