Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/react-native/React/Base/RCTKeyCommands.m
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,13 @@ - (void)handleKeyUIEventSwizzle:(UIEvent *)event
}
}

// Ignore key commands (except escape) when there's an active responder
if (!firstResponder) {
// When there's an active responder, ignore key commands that don't use a
// shortcut modifier (Command/Control/Option) so that typing into a focused
// view (e.g. a text field) isn't intercepted. Shift and Caps Lock don't
// count here since they're part of normal text input. Commands with a
// shortcut modifier (e.g. Cmd+D to open the Dev Menu) should still fire.
UIKeyModifierFlags shortcutModifiers = UIKeyModifierCommand | UIKeyModifierControl | UIKeyModifierAlternate;
if (!firstResponder || (modifierFlags & shortcutModifiers) != 0) {
[self RCT_handleKeyCommand:modifiedInput flags:modifierFlags];
}
}
Expand Down
Loading