Description of the problem
The 'click' event is not fired for AlertDialog in mobile web (Chrome Desktop). The same works fine with SDK 3.1.3.
Code to reproduce
Using the code in the docs
Ti.UI.setBackgroundColor('white');
var win = Ti.UI.createWindow({
title: 'Click window to test',
backgroundColor: 'white',
exitOnClose: true,
fullscreen: false
});
win.addEventListener('click', function(e){
var dialog = Ti.UI.createAlertDialog({
cancel: 1,
buttonNames: ['Confirm', 'Cancel', 'Help'],
message: 'Would you like to delete the file?',
title: 'Delete'
});
dialog.addEventListener('click', function(e){
if (e.index === e.source.cancel){
Ti.API.info('The cancel button was clicked');
}
Ti.API.info('e.cancel: ' + e.cancel);
Ti.API.info('e.source.cancel: ' + e.source.cancel);
Ti.API.info('e.index: ' + e.index);
});
dialog.show();
});
win.open();
Pull request: https://github.com/appcelerator/titanium_mobile/pull/5695
Clicking on the buttons in the alert dialog dismisses the dialog and fires the logging messages.
Tested the above code using Mac osx 10.9.3 Mavericks Appcelerator Studio, build: 3.3.0.201405271647 Titanium SDK, build: 3.3.0.v20140528144113 Node.JS Version: v0.10.13 NPM Version: 1.3.2 acs@1.0.14 alloy@1.4.0-beta npm@1.3.2 titanium@3.3.0-beta titanium-code-processor@1.1.1 Device: iPhone5C iOS 7.1 Safari native browser Safari browser 7.0.4 1. Mobile Web Preview in Browser 2. Preview of a packaged for Mobile Web app Pass for both cases Closing as fixed.