[TIMOB-15851] iOS: Click event in html does not get fired when click event in webView is attached
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2013-12-02T19:23:18.000+0000 |
Affected Version/s | Release 3.2.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | dev-invalidate, qe-3.2.0, qe-closed-3.3.0 |
Reporter | Pragya Rastogi |
Assignee | Ingo Muschenetz |
Created | 2013-11-29T10:44:23.000+0000 |
Updated | 2014-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();
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.
Closing as its expected behavior.