Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15851] iOS: Click event in html does not get fired when click event in webView is attached

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2013-12-02T19:23:18.000+0000
Affected Version/sRelease 3.2.0
Fix Version/sn/a
ComponentsiOS
Labelsdev-invalidate, qe-3.2.0, qe-closed-3.3.0
ReporterPragya Rastogi
AssigneeIngo Muschenetz
Created2013-11-29T10:44:23.000+0000
Updated2014-07-17T09:39:26.000+0000

Description

Alert event does not get fired when in html with a click event attached in webView. Once webView eventlistener is commented out the click event in html gets fired. Steps: 1. Use below code and run the app (Actual: Click event with "123456" message does not get fired.) 2. Comment eventlistener below html code containing alert and observe "123456" alert appears Expected: Click event in html must also work fine along with other alerts.
var _window = Titanium.UI.createWindow();
_window.backgroundColor = 'yellow';

	_window.addEventListener('click', function(e) {
		alert('Window clicked');
	});
	var webView = Titanium.UI.createWebView({
		top : 30
	});
	var html = '<html>' + '<body>' + '<br />' + '<br />' + '<br />' + '<br />' + '<br />' + '<br />' + '<a onclick="javascript:alert(123456)">Click me!</a>' + '</body>' + '</html>';
	webView.html = html;
//Comment below event listener to get alert(123456)
webView.addEventListener('click', function(e) {
	alert('WebView Clicked');
	});
	_window.add(webView);
_window.open();

Comments

  1. Sabil Rahim 2013-12-02

    This is not a bug. This is the expected behavior and is documented in our docs. http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.WebView - read iOS Platform Implementation Notes.
  2. Pragya Rastogi 2014-07-17

    Closing as its expected behavior.

JSON Source