[
https://issues.apache.org/jira/browse/CB-5373?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mike Kwan updated CB-5373:
--------------------------
Description:
*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.
was:
*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://hostr.co/file/mt2TZrCaf51a/Screen-Shot-2013-11-13-at-12.22.08.png!
Example project demonstrating bug:
https://hostr.co/SVeUlWyvGPyp
> 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)