JS Dialog: Click in second time dialog does not call callback function#11
JS Dialog: Click in second time dialog does not call callback function#11tuanna222 wants to merge 1 commit intoplay-co:masterfrom tuanna222:patch-1
Conversation
fix dialog does not show when using multi native dialog on app.
|
This wipes all the dialogCallbacks -- is that the optimal behavior? Can you put together a repro case for me so I can validate this pull request and merge it in? |
|
@tuanna222 - can you post an entire Application.js so we can work from exactly the same place? |
|
Application.js import ui.TextView as TextView;
exports = Class(GC.Application, function () {
this.initUI = function () {
var button1 = new TextView({
superview: this.view,
text: "button 1",
color: "white",
x: 0,
y: 100,
width: this.view.style.width,
height: 100
});
button1.on("InputSelect", bind(this,function(){
var cancel = { label: "Cancel", callback: function () {} };
var accept = { label: "Accept", callback: function () {
var ok = { label: "OK", callback: function () {} };
NATIVE.dialogs.showDialog("accept dialog 1", "accept successfully.", "",[ok]);
} };
NATIVE.dialogs.showDialog("In-app purchase",
"Are you sure you want to buy ABC package with $1.99 ?",
"",
[cancel, accept]);
}));
};
this.launchUI = function () {};
});run: devkit debug android |
|
Fantastic, thank you. I'll start looking into this today and get back to you as soon as I can. |
|
It looks like the problem is deeper than this - this example crashes ios completely for me, and the proposed fix doesn't solve the problem on my end either. This pull request deletes all the existing callbacks after a button is pressed on a dialog, but after the correct callback fires. This feels a bit dodgy, although I suppose the use case assumes you aren't showing more than one dialog at a time. @mgh - thoughts on this situation? |
|
|
@tuanna222 - I see that your change allows the second dialog to fire on android. I added a third nested dialog in the same fashion as a test case and I can't get the third one to open up with your fix applied. Working on that more. |
fix dialog does not show when using multi native dialog on app.