You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dfa20e1
Browse filesBrowse the repository at this point in the historyBrowse files
Do not report modifier keys pressed alone in Android TextInput onKeyPress
A modifier key pressed alone - Shift, Control, Alt, Meta, Fn, Sym, Num
and the lock keys - types nothing, so onKeyPress does not report it,
whether the keyboard sends it to the view or the input method forwards
it. It reaches onKeyPress as the altKey, ctrlKey, metaKey and shiftKey
of the key it is held with. View onKeyDown keeps reporting it.
Copy file name to clipboardExpand all lines: packages/react-native/ReactAndroid/src/test/java/com/facebook/react/views/textinput/ReactEditTextKeyPressTest.kt
+37-5Lines changed: 37 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -189,22 +189,35 @@ class ReactEditTextKeyPressTest {
* where keyValue is 'Enter' or 'Backspace' for respective keys and the typed-in character otherwise including ' ' for space.
879
879
*
880
880
* Fires before onChange callbacks.
881
-
* On Android, keys pressed on a hardware keyboard are reported as well, each by its KeyboardEvent.key value (such as 'ArrowLeft', 'Shift' or 'F1'), with altKey, ctrlKey, metaKey and shiftKey set for the modifier keys held.
881
+
* On Android, keys pressed on a hardware keyboard are reported as well, each by its KeyboardEvent.key value (such as 'ArrowLeft', 'Home' or 'F1'), with altKey, ctrlKey, metaKey and shiftKey set for the modifier keys held. A modifier key pressed alone is not reported.
0 commit comments