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:
Siqi Liu 2016-06-14 05:29:55 -07:00 committed by Facebook Github Bot 7
parent b90b57c9a1
commit 1e88c1261c
2 changed files with 0 additions and 22 deletions

View File

@ -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
}

View File

@ -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];
}