Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16931] MobileWeb: AlertDialog click listener is not fired in SDK >= 3.2.0

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-05-23T20:51:26.000+0000
Affected Version/sn/a
Fix Version/s2014 Sprint 10, 2014 Sprint 10 Tooling, Release 3.3.0
ComponentsMobileWeb
Labelsmobileweb, qe-closed-3.3.0, qe-testadded, regression, supportTeam
ReporterDavide Cassenti
AssigneeChris Barber
Created2014-05-08T14:22:14.000+0000
Updated2014-08-05T20:46:39.000+0000

Description

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();

Comments

  1. Chris Barber 2014-05-16

    Pull request: https://github.com/appcelerator/titanium_mobile/pull/5695
  2. Tim Poulsen 2014-05-16

    Clicking on the buttons in the alert dialog dismisses the dialog and fires the logging messages.
  3. Olga Romero 2014-05-29

    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.

JSON Source