[ReactNative] Workaround double cmd+r bug

This commit is contained in:
Christopher Chedeau
2015-04-02 16:41:33 -07:00
parent 03cf69dde1
commit df851b38fc

View File

@@ -626,6 +626,15 @@ static id<RCTJavaScriptExecutor> _latestJSExecutor;
- (void)bindKeys
{
#if TARGET_IPHONE_SIMULATOR
// Workaround around the first cmd+r not working: http://openradar.appspot.com/19613391
// You can register just the cmd key and do nothing. This will trigger the bug and cmd+r
// will work like a charm!
[[RCTKeyCommands sharedInstance] registerKeyCommandWithInput:@""
modifierFlags:UIKeyModifierCommand
action:^(UIKeyCommand *command) {
// Do nothing
}];
[[RCTKeyCommands sharedInstance] registerKeyCommandWithInput:@"r"
modifierFlags:UIKeyModifierCommand
action:^(UIKeyCommand *command) {