You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2013/11/14 22:19:22 UTC

[jira] [Commented] (CB-5373) CDVViewController does not support shifted UIWebView with HideKeyboardFormAccessoryBar

    [ https://issues.apache.org/jira/browse/CB-5373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13822932#comment-13822932 ] 

ASF subversion and git services commented on CB-5373:
-----------------------------------------------------

Commit e1b942e60d3ad01ba48224f1d51595c3ad2e322b in branch refs/heads/master from [~agrieve]
[ https://git-wip-us.apache.org/repos/asf?p=cordova-plugins.git;h=e1b942e ]

CB-5373 Fix HideKeyboardFormAccessoryBar work when UIWebView is not at (0,0)


> CDVViewController does not support shifted UIWebView with HideKeyboardFormAccessoryBar
> --------------------------------------------------------------------------------------
>
>                 Key: CB-5373
>                 URL: https://issues.apache.org/jira/browse/CB-5373
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 3.1.0
>            Reporter: Mike Kwan
>         Attachments: Screen Shot 2013-11-13 at 12.22.08.png, ios.zip
>
>
> *CDVViewController* does not play well with the *HideKeyboardFormAccessoryBar* set to *true* when the *UIWebView* has its origin shifted.
> To reproduce this:
>  - Create skeleton project via CLI
>  - Configure *content src* to *http://www.google.co.uk/*
>  - Configure *HideKeyboardFormAccessoryBar* to *true*
>  - In the MainViewController add the following method:
> {code}- (void)viewDidLoad
> {
>     [super viewDidLoad];
>     
>     CGRect frame = [[self view] bounds];
>     frame.origin.y += 20;
>     frame.size.height -= 20;
>     
>     [self.webView setFrame:frame];
> }{code}
>  - Load page, trigger keyboard by giving focus to the input field and dismiss the keyboard by tapping back on the page
> The reason the bug occurs is because of the following line in *CDVViewController* in *hideKeyboardFormAccessoryBarEnd:*:
> {code}self.webView.scrollView.frame = self.webView.frame;{code}
> This will work as expected only if the *scrollView* origin matches the *UIWebView* origin which happens only at (0, 0). The correct code should be:
> {code}self.webView.scrollView.frame = CGRectMake(0, 0, self.webView.frame.size.width, self.webView.frame.size.height);{code}
> An example of the *scrollView* frame being set incorrectly:
> !https://issues.apache.org/jira/secure/attachment/12613590/Screen%20Shot%202013-11-13%20at%2012.22.08.png!
> Minimal example reproducing bug is attached.



--
This message was sent by Atlassian JIRA
(v6.1#6144)