From e538bad17f1f06163c956baeda1b758caf8b1a0b Mon Sep 17 00:00:00 2001 From: Sean Bannigan Date: Wed, 3 Jun 2020 12:43:09 -0400 Subject: [PATCH] fix(ios): update frame immediately when keyboard hides (#3038) --- ios/Capacitor/Capacitor/Plugins/Keyboard.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ios/Capacitor/Capacitor/Plugins/Keyboard.m b/ios/Capacitor/Capacitor/Plugins/Keyboard.m index 933e04191c..dd323851ca 100644 --- a/ios/Capacitor/Capacitor/Plugins/Keyboard.m +++ b/ios/Capacitor/Capacitor/Plugins/Keyboard.m @@ -116,6 +116,7 @@ - (void)onKeyboardWillHide:(NSNotification *)notification [self.bridge triggerWindowJSEventWithEventName:@"keyboardWillHide"]; [self notifyListeners:@"keyboardWillHide" data:nil]; }]; + [[NSRunLoop currentRunLoop] addTimer:hideTimer forMode:NSRunLoopCommonModes]; } - (void)onKeyboardWillShow:(NSNotification *)notification @@ -171,7 +172,7 @@ - (void)setKeyboardHeight:(int)height delay:(NSTimeInterval)delay if (delay == 0) { [self _updateFrame]; } else { - [weakSelf performSelector:action withObject:nil afterDelay:delay]; + [weakSelf performSelector:action withObject:nil afterDelay:delay inModes:@[NSRunLoopCommonModes]]; } }