Titanium JIRA Archive
Appcelerator Community (AC)

[AC-5030] Dialog box click not triggered

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionDuplicate
Resolution Date2017-06-16T18:34:38.000+0000
Affected Version/sAppcelerator Studio 4.5.0
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterGuile
AssigneeShak Hossain
Created2017-06-15T16:06:00.000+0000
Updated2017-06-16T18:34:38.000+0000

Description

The following code show a problem between alert dialog and controller. I create an empty project, create an empty controller called 'test', then put this code in index.js When you click on the label, its text is changed to "dialog open" When you answer to the dialog, the label text is set to "dialog closed" Because of the Alloy.createController() line , the click event is not triggered even if the dialog is closed. This happened very randomly (not at every time, I have to test it many time, by waiting few second before answer to the dialog). I noticed this behaviour very rarely (but it may occur) without the createController, and it happens more often when I put createController() use case : I use the widget fokkezb.loading that create a controller, and sometimes I need to open a dialog alert.

function doClick(e) {
    Alloy.createController('test');

    var a = Titanium.UI.createAlertDialog({
        title : 'b',
        message : 'a',
        buttonNames : ['Y', 'N'],
        cancel : 1
    });
    a.addEventListener('click', function() {
        $.label.text = 'dialog closed';
    });
    $.label.text = 'dialog open';
    a.show();
}

$.index.open();

Comments

  1. Guile 2017-06-15

    Seems this is due to the property true I set to true and didn't manage to reproduce the bug
  2. Guile 2017-06-15

    This issue is related with TIMOB-24349 ...
  3. Hans Knöchel 2017-06-16

    Thanks! So it does **not** work with run-on-main-thread set to true? I would like to close it as Duplicate then and put the related ticket on our list asap.

JSON Source