UIWebView does not scale its contents properly after the virtual keyboard has been shown and the control's dimensions are changed

Originator:thephatmann
Number:rdar://15547490 Date Originated:11/25/2013
Status:Open Resolved:
Product:iOS SDK Product Version:
Classification: Reproducible:yes
 
Summary:
The UIWebView control does not scale its contents properly after the virtual keyboard has been shown and the control's dimensions are changed. Specifically, the control incorrectly scales the contents to the dimensions it had when the keyboard was shown. 

Refreshing the page sometimes fixes the issue, but not always. In any case, refreshing the page is not an option for us.

We ran into this issue because our app has a web view and a side bar that slides in and out. When the side bar slides in or out, it makes the web view next to it narrower. The web view stopped scaling the contents properly after the user tapped into a text field in the web page.

Steps to Reproduce:
1. Create a view with a UIWebView pinned to all sides.
2. Turn on the "Scales Page to Fit" option for UIWebView.
3. Add code to view controller to load a URL into the web view.
4. Run the app on iPad.
5. Tap into a text field on web page
6. Rotate the device.

Expected Results:
UIWebView scales its contents to its new dimensions

Actual Results:
UIWebView does scale its contents to its new dimensions. Instead it uses the dimensions it has before the keyboard was shown.

Version:
Occurs on iOS 6 and 7

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!