cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject git commit: CB-6563 - Keyboard: Fix issue with UIPickerViews breaking. (closes #11)
Date Wed, 30 Apr 2014 00:41:50 GMT
Repository: cordova-plugins
Updated Branches:
  refs/heads/master 178658b1e -> 34912f809


CB-6563 - Keyboard: Fix issue with UIPickerViews breaking.
(closes #11)

Going from a keyboard to a select dropdown picker triggered the show
handler without ever calling the hide handler. Going from a select list
to a keyboard triggered show again. At this point, the UIWebView had
been shrunk to the point of having a height of 0.

Signed-off-by: Shazron Abdullah <shazron@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugins/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugins/commit/34912f80
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugins/tree/34912f80
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugins/diff/34912f80

Branch: refs/heads/master
Commit: 34912f80900b9d23bdf09997a19dd9dee21aa86e
Parents: 178658b
Author: Darryl Pogue <darryl@ayogo.com>
Authored: Tue Apr 29 15:08:14 2014 -0700
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Tue Apr 29 17:41:16 2014 -0700

----------------------------------------------------------------------
 keyboard/src/ios/CDVKeyboard.m | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/34912f80/keyboard/src/ios/CDVKeyboard.m
----------------------------------------------------------------------
diff --git a/keyboard/src/ios/CDVKeyboard.m b/keyboard/src/ios/CDVKeyboard.m
index 705b6c5..17bb3e5 100644
--- a/keyboard/src/ios/CDVKeyboard.m
+++ b/keyboard/src/ios/CDVKeyboard.m
@@ -260,7 +260,10 @@
     if (!_shrinkView) {
         return;
     }
-    _savedWebViewFrame = self.webView.frame;
+
+    if (CGRectIsEmpty(_savedWebViewFrame)) {
+        _savedWebViewFrame = self.webView.frame;
+    }
 
     CGRect keyboardFrame = [notif.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
     keyboardFrame = [self.viewController.view convertRect:keyboardFrame fromView:nil];
@@ -293,11 +296,10 @@
     keyboardFrame = [self.viewController.view convertRect:keyboardFrame fromView:nil];
 
     CGRect newFrame = _savedWebViewFrame;
-    newFrame.size.width = self.viewController.view.bounds.size.width - _savedWebViewFrame.origin.x;
-    newFrame.size.height = self.viewController.view.bounds.size.height - _savedWebViewFrame.origin.y;
-    
     self.webView.scrollView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
     self.webView.frame = newFrame;
+
+    _savedWebViewFrame = CGRectNull;
 }
 
 // //////////////////////////////////////////////////


Mime
View raw message