Skip to content

Commit e1a7e37

Browse files
(ios) Limit the keyboard dismissal bug fix to ios [11.0, 13.4) because in ios 13.4 Apple fixed the problem.
See ionic-team#533 (comment)
1 parent d82b0f3 commit e1a7e37

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/ios/CDVWKWebViewEngine.m

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -408,12 +408,18 @@ - (void)pluginInitialize
408408
selector:@selector(onSocketError:)
409409
name:@"socketInUseError" object:nil];
410410

411+
// If greater than 11
411412
if (@available(iOS 11.0, *)) {
412-
// For keyboard dismissal leaving viewport shifted (can potentially be removed when apple releases the fix for the issue discussed here: https://github.com/apache/cordova-ios/issues/417#issuecomment-423340885)
413-
[[NSNotificationCenter defaultCenter]
414-
addObserver:self
415-
selector:@selector(keyboardWillHide)
416-
name:UIKeyboardWillHideNotification object:nil];
413+
// And less than 13.4
414+
if (@available(iOS 13.4, *)) {} else {
415+
// For keyboard dismissal leaving viewport shifted
416+
// Can potentially be removed when apple releases the fix for the issue discussed here: https://github.com/apache/cordova-ios/issues/417#issuecomment-423340885
417+
// Apple has released a fix in 13.4, but not in 12.x (as of 12.4.6)
418+
[[NSNotificationCenter defaultCenter]
419+
addObserver:self
420+
selector:@selector(keyboardWillHide)
421+
name:UIKeyboardWillHideNotification object:nil];
422+
}
417423
}
418424

419425
NSLog(@"Using Ionic WKWebView");

0 commit comments

Comments
 (0)