From ab055935c62955e39b39622d160a0aeefab331ed Mon Sep 17 00:00:00 2001 From: Kaloyan Yosifov Date: Thu, 31 Oct 2019 17:53:23 +0200 Subject: [PATCH 1/2] Add configurable option to delay keyboard view --- src/ios/CDVIonicKeyboard.m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ios/CDVIonicKeyboard.m b/src/ios/CDVIonicKeyboard.m index e4615a8..ee935ff 100644 --- a/src/ios/CDVIonicKeyboard.m +++ b/src/ios/CDVIonicKeyboard.m @@ -155,10 +155,19 @@ - (void)onKeyboardWillShow:(NSNotification *)note } CGRect rect = [[note.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; double height = rect.size.height; + double delayedDuration = 0.2; + + NSDictionary *settings = self.commandDelegate.settings; + NSString *delayDurationString = [settings cordovaSettingForKey:@"KeyboardDelayDuration"]; + + if (delayDurationString) { + // convert string into double + delayedDuration = [delayDurationString doubleValue]; + } if (self.isWK) { double duration = [[note.userInfo valueForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]; - [self setKeyboardHeight:height delay:duration+0.2]; + [self setKeyboardHeight:height delay:duration+delayedDuration]; [self resetScrollView]; } From 318356d1b03582573c1e8d2786c60760b8e1eed1 Mon Sep 17 00:00:00 2001 From: Kaloyan Yosifov Date: Thu, 31 Oct 2019 17:56:04 +0200 Subject: [PATCH 2/2] Add option descripton in readme --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 4674035..6a35dbe 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,16 @@ cordova plugin add cordova-plugin-ionic-keyboard --save ## Preferences +### KeyboardDelayDuration (for IOS Only) + +When styling your app like the Login page with (vh). The keyboard open delay might not be desirable. So this option can be used to configure the delay in which the keyboard is open. + +> Double (0.2 by default) + +```xml + +``` + ### KeyboardResize (for iOS only) > Boolean (true by default)