Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7547] iOS: Webview should be able to handle events even if the parent view defines some events as well (Parity issue)

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-02-14T23:29:05.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sSprint 2012-03, Release 2.0.0, Release 1.8.2
ComponentsiOS
Labelsmodule_webview, parity, qe-testadded
ReporterMauro Parra-Miranda
AssigneeVishal Duggal
Created2012-02-03T15:33:46.000+0000
Updated2012-02-14T23:29:05.000+0000

Description

Problem Description

Customer wants to have a webview as part of the UI in a tablet. That webview will be showing interactive stuff, so you can actually interact with it. That webview is being added on top of a view with attached events.

Expected Results

Being able to interact with the webview, even if the parent view has related events. This is, If I'm clicking on the webview, the webview should work as usual, and if I click outside the webview, the parent view should do the

Actual Results

In Android, this works just fine. In iOS, the webview is blocked to any activity.

Test Case

var win=Ti.UI.createWindow();
var view=Ti.UI.createView();
var webview=Ti.UI.createWebView({
	url:'http://google.com',
});

view.addEventListener('click', function(){
	Ti.API.info('Click!');
});

view.add(webview);
win.add(view);
win.open();

Extra info

For the customer would be handy if we can set a way to tell the webview to not pass events to the parent, and continue handling it's own events.

Comments

  1. Vishal Duggal 2012-02-06

    Use this code to test
       var win=Ti.UI.createWindow();
       var view=Ti.UI.createView();
       var webview=Ti.UI.createWebView({
       	url:'http://google.com',
       	height:"50%"
       });
       
       var btn = Ti.UI.createButton({
       	title: "Toggle Touches",
       	width: "100%",
       	height: 30,
       	bottom: 0,
       	left: 0
       });
       
       btn.addEventListener("click",function(e){
       	Ti.API.info(webview.willHandleTouches+" "+webview.getWillHandleTouches())
       	var current = webview.willHandleTouches;
       	
       	if(current === true)
       	{
       		webview.willHandleTouches = false;
       	}
       	else
       	{
       		webview.setWillHandleTouches(true);
       	}
       });
       
       
       
       view.addEventListener('click', function(e){
       	
       	if(e.source == webview)
       	{
       		Ti.API.info("Source is WebView");
       	}
       	if(e.source == view)
       	{
       		Ti.API.info("Source is View");
       	}
       	if(e.source == btn)
       	{
       		Ti.API.info("Source is Button");
       	}
       	Ti.API.info('View Got Click!');
       });
       
       
       view.add(webview);
       view.add(btn);
       win.add(view);
       win.open();
       
  2. Wilson Luu 2012-02-07

    Closing bug. Verified fix on: SDK build: 1.9.0.v20120207000134 Titanium Studio, build: 1.0.8.201201262211 xcode: 4.2 Devices: iPhone 4S Sprint (5.0.1)

JSON Source