Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7569] iPhone: Opening a normal window after a modal window will reopen the normal window on close of modal

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2012-02-14T23:29:03.000+0000
Affected Version/sn/a
Fix Version/sSprint 2012-03, Release 2.0.0, Release 1.8.2
ComponentsiOS
Labelsmodule_window, parity, qe-testadded
ReporterPedro Enrique
AssigneeStephen Tramer
Created2012-02-07T14:46:06.000+0000
Updated2013-12-10T06:21:17.000+0000

Description

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.

Comments

  1. Michael Pettiford 2012-02-10

    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
  2. Shameer Jan 2013-12-10

    Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/4967

JSON Source