Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25977

Android: AlertDialog not firing "click" event when canceled

    Details

    • Story Points:
      2
    • Sprint:
      2018 Sprint 08 SDK

      Description

      The alert dialog doesn't fire a cancel event if you press outside of the alertDialog box in 7.1.0. The event listener actually doesn't console anything if done this way. If you switch it back to 6.2.2 it works correctly and fires the eventlistener when the user touches outside of the alert dialog.

      Make a sample AppSellHerHater project and paste the index.js below. Then build to android on 7.1.0 and watch it not work. Then build with 6.2.2 and watch it work correctly.

      //Replace the index.js code with this
      function doClick(e) {
      	myAlert.show();
      }
       
      $.index.open();
       
      var myAlert = Ti.UI.createAlertDialog({
      	cancel: 1,
      	buttonNames: ['Ok', 'Cancel'],
      	message: "Event listener doesn't fire if you press outside of alert on android...",
      	title: 'Confirm Ok'
      });
       
      myAlert.addEventListener('click', function(e) {
      	console.info('e.index: ' + e.index);
      	$.label.text = (e.index == 0) ? "You pressed 'Ok'..." : "You cancelled the alert...";
      	alert('e.index: ' + e.index);
      });
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jquick Joshua Quick
                Reporter:
                josh.mocek josh.mocek
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-6311
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code