Problem description
Opening a window just after a modal is closed will not work.
Steps to reproduce
Use the following code to see the issue:
(function() {
var mainWindow = Ti.UI.createWindow({
backgroundColor: '#fff',
});
mainWindow.button = Ti.UI.createButton({
title: 'Open Modal Window'
});
mainWindow.add(mainWindow.button);
var modalWindow = Ti.UI.createWindow({
modal: true,
backgroundColor: '#ccc'
});
modalWindow.button = Ti.UI.createButton({
title: 'Close'
});
modalWindow.add(modalWindow.button);
mainWindow.button.addEventListener('click', function(){
modalWindow.open({modalStyle:Ti.UI.iPhone.MODAL_PRESENTATION_FORMSHEET});
});
modalWindow.button.addEventListener('click', function(){
modalWindow.close();
var newWindow = Ti.UI.createWindow({
backgroundColor: 'green'
});
/* If I delay opening the window I get the behaviour I had prior to this release.
setTimeout(function(){
newWindow.open()
}, 300);*/
newWindow.open();
});
mainWindow.open();
})();
Note
The same code works with SDK 2.1.2; also, commenting newWindow.open() and uncommenting the timeout, works too. It also works removing modal = true
This took advantage of a bug in 2.1.2 which was fixed in 2.1.3. We need to document how to do this correctly as a release note.
Open the new window in the modal window close handler
Closing ticket as "Won't Fix".