Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9039] Android: Having an hidden iFrame in WebView HTML prevents scrolling on Android

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-03-19T08:54:15.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sRelease 3.0.2
ComponentsAndroid
Labelscore
ReporterRobert Spriggs
Assigneejithinpv
Created2012-05-06T22:48:03.000+0000
Updated2017-03-17T18:39:53.000+0000

Description

Reproduction steps: * Create an application that uses a web view. * Include a hidden iFrame in the HTML code (
) with other content that extends beyond the bottom of the page. * The page should scroll with touch/swipe upwards. * When deployed on Android, the page will not scroll. * Unhide the iFrame, or remove the iFrame and the page scrolls as expected. Example code (project/test case attached)
//Application Window Component Constructor
var myWebView;

function ApplicationWindow() {
	//load component dependencies
//	var FirstView = require('ui/FirstView');
		
	//create component instance
	var self = Ti.UI.createWindow({
		backgroundColor:'#ffffff',
		navBarHidden:true,
		exitOnClose:true,
		width: 320,
		height: 480,
		modal: true
	});

	// Create the webview
	myWebView = Ti.UI.createWebView();
//	myWebView.willHandleTouches  = false;
	self.add(myWebView);	//construct UI

	var html = '<!doctype html>' +
'<html class="no-js" lang="en">' +
'<head>' +
  
'  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' +
'  <title>Demo Page</title>' +

'  <meta name="viewport" content="width=320, user-scalable=no" />' +
'</head>' +
'<body onload="ApplyAfterLoad();">' +
'<h2>Dynamic HTML</h2>' +
'  <h1>Example of iFrame Error - Android</h1' +
'  <div style="display: none; border: 1px solid red;">' + 
'      <iframe class="youtube-player" type="text/html" width="289" height="149"  src="http://www.youtube.com/embed/1ZJQe9EpPL0?showinfo=0&modestbranding=1&autohide=1" frameborder="0" allowfullscreen></iframe>' +
'  </div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'  <div>Text - should scroll</div>' +
'</body>' +
'</html>';


	myWebView.setHtml(html);

	return self;
	
}



//make constructor function the public component interface
module.exports = ApplicationWindow;

Attachments

FileDateSize
Android Error Demo 2.zip2012-05-06T22:48:03.000+00003126653

Comments

  1. Robert Spriggs 2012-05-06

    Just to clarify the example above, setting "height" and "modal" from the createWindow should be removed from the test case above. They don't change anything and were just a multitude of things being tried to make it work.
  2. jithinpv 2013-03-19

    Issue does not reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) Device: Samsung galaxy s duos Android version: 4.0.4 jithinpv
  3. Lee Morris 2017-03-17

    Closing ticket as the issue cannot be reproduced.

JSON Source