From df851b38fcc6ae82faa790169c84f06eea4d9b69 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Thu, 2 Apr 2015 16:41:33 -0700 Subject: [PATCH] [ReactNative] Workaround double cmd+r bug --- React/Base/RCTBridge.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/React/Base/RCTBridge.m b/React/Base/RCTBridge.m index f7ac0fe19bb..1ad3d58b75d 100644 --- a/React/Base/RCTBridge.m +++ b/React/Base/RCTBridge.m @@ -626,6 +626,15 @@ static id _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) {