Skip to content

Commit e538bad

Browse files
authored
fix(ios): update frame immediately when keyboard hides (#3038)
1 parent a8ad95d commit e538bad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ios/Capacitor/Capacitor/Plugins/Keyboard.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ - (void)onKeyboardWillHide:(NSNotification *)notification
116116
[self.bridge triggerWindowJSEventWithEventName:@"keyboardWillHide"];
117117
[self notifyListeners:@"keyboardWillHide" data:nil];
118118
}];
119+
[[NSRunLoop currentRunLoop] addTimer:hideTimer forMode:NSRunLoopCommonModes];
119120
}
120121

121122
- (void)onKeyboardWillShow:(NSNotification *)notification
@@ -171,7 +172,7 @@ - (void)setKeyboardHeight:(int)height delay:(NSTimeInterval)delay
171172
if (delay == 0) {
172173
[self _updateFrame];
173174
} else {
174-
[weakSelf performSelector:action withObject:nil afterDelay:delay];
175+
[weakSelf performSelector:action withObject:nil afterDelay:delay inModes:@[NSRunLoopCommonModes]];
175176
}
176177
}
177178

0 commit comments

Comments
 (0)