From 6f9ee99d9291c5717fe03f1da5aff67e7520e1ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20G=C5=82ogocki?= Date: Fri, 21 Jan 2022 17:57:13 +0100 Subject: [PATCH] Allow to enable/disable AdjustScrollView to automatically scroll focused control into view when keyboard is shown --- src/ios/CDVIonicKeyboard.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ios/CDVIonicKeyboard.m b/src/ios/CDVIonicKeyboard.m index e4615a8..ab8f13b 100644 --- a/src/ios/CDVIonicKeyboard.m +++ b/src/ios/CDVIonicKeyboard.m @@ -113,7 +113,9 @@ - (void)pluginInitialize NSLog(@"CDVIonicKeyboard: WARNING!!: Keyboard plugin works better with WK"); } - if (isWK) { + BOOL disabledAdjustScrollView = ![settings cordovaBoolSettingForKey:@"AdjustScrollView" defaultValue:YES]; + + if (isWK && disabledAdjustScrollView) { [nc removeObserver:self.webView name:UIKeyboardWillHideNotification object:nil]; [nc removeObserver:self.webView name:UIKeyboardWillShowNotification object:nil]; [nc removeObserver:self.webView name:UIKeyboardWillChangeFrameNotification object:nil];