Disable the double R shortcut to reload JS in iOS
Summary: Disable double R shortcut temporarily to fix a bug. Reviewed By: majak Differential Revision: D3428043 fbshipit-source-id: 23795b72433230e49d5ab559c0cb828bce8196ea
This commit is contained in:
parent
b90b57c9a1
commit
1e88c1261c
|
@ -172,15 +172,6 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
|||
userInfo:nil];
|
||||
}];
|
||||
|
||||
|
||||
[commands registerDoublePressKeyCommandWithInput:@"r"
|
||||
modifierFlags:0
|
||||
action:^(__unused UIKeyCommand *command) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:RCTReloadNotification
|
||||
object:nil
|
||||
userInfo:nil];
|
||||
}];
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -108,19 +108,6 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
|||
|
||||
- (NSArray<UIKeyCommand *> *)RCT_keyCommands
|
||||
{
|
||||
/*
|
||||
* If current first responder is UITextView or UITextField, disable the shortcut key commands.
|
||||
* For example, double-pressing a key should type two characters into the text view,
|
||||
* not invoke a predefined keyboard shortcut.
|
||||
*/
|
||||
UIResponder *firstResponder = [UIResponder RCT_getFirstResponder: self];
|
||||
if ([firstResponder isKindOfClass:[UITextView class]] ||
|
||||
[firstResponder isKindOfClass:[UITextField class]] ||
|
||||
[firstResponder conformsToProtocol:@protocol(UITextViewDelegate)] ||
|
||||
[self conformsToProtocol:@protocol(UIApplicationDelegate)]) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSSet<RCTKeyCommand *> *commands = [RCTKeyCommands sharedInstance].commands;
|
||||
return [[commands valueForKeyPath:@"keyCommand"] allObjects];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue