The problem:
When opening a non-modal window on top of a modal, that window will be still opened after itself, as well as the modal window, is closed.
The sample code:
function modalWindow(){
var b = Ti.UI.createButton({title:'close'});
var a = Ti.UI.createButton({title:'open win'});
var w = Ti.UI.createWindow({
backgroundColor:'red',
rightNavButton:b,
leftNavButton:a
});
w.add(Ti.UI.createLabel({text:'This is a normal window', top:20, textAlign:'center', height:40, backgroundColor:'white'}));
b.addEventListener('click', function(){
w.close();
});
a.addEventListener('click', function(){
normalWindow().open();
});
return w;
}
function normalWindow(){
var b = Ti.UI.createButton({title:'close',width:200,height:40, top:100});
var w = Ti.UI.createWindow({
backgroundColor:'blue'
});
w.add(Ti.UI.createLabel({text:'This is a normal window', top:20, textAlign:'center', height:40, backgroundColor:'white'}));
w.add(b);
b.addEventListener('click', function(){
w.close();
});
return w;
}
(function(){
var win = Ti.UI.createWindow({
backgroundColor:'green'
});
var btn = Ti.UI.createButton({
width:100,
height:40,
title:'open modal'
});
win.add(btn);
btn.addEventListener('click', function(){
modalWindow().open({modal:true});
});
win.open();
})();
To Reproduce:
1. Open run the app in app.js.
2. Open the modal window with the white button.
3. Open the normal window with the nav button with title: "open win"
4. Close that window
5. Close the modal window
Result:
The normal window appears again after it has been closed.
Closing issue Tested with Ti Studio build 1.0.8.201201262211 Ti Mob SDK 1.9.0.v20120210144634 OSX Lion 10.7.3 iPhone 4S OS 5.0.1, iPhone Sim 4.3 Verified expected behavior occurs
Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/4967