Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13111] iOS: cannot open a modal window before a previous one is closing (with animation)

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2013-04-15T17:13:31.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterDavide Cassenti
AssigneeIngo Muschenetz
Created2013-03-19T12:45:21.000+0000
Updated2017-03-20T20:47:20.000+0000

Description

Problem description

When opening a modal windows with animation, if a previous modal is still closing, the opening fails and an error is reported:
[ERROR] :  Script Error = Attempting to begin a modal transition from <UINavigationController: 0xd140570> to <UINavigationController: 0x14b69080> while a transition is already in progress. Wait for viewDidAppear/viewDidDisappear to know the current transition has completed at app.js (line 25).

Steps to reproduce

Use the following code:
var win = Ti.UI.createWindow({
	backgroundColor: 'black',
	fullscreen: true
});

win.addEventListener('click', function() {
	openWin();
});

win.open();

function openWin() {
	var win = Ti.UI.createWindow({
		backgroundColor: 'white',
		modal: true
	});

	win.addEventListener('click', function() {
		win.close();
		openWin();
	});

	// setTimeout(function() {
		win.open({
			animated: true
		});
	// }, 500);
}
1. Run the app: you will see just a black screen 2. Click on the window, and it will open a modal window with animation 3. Click on the new opened window: the error will be shown

Workaround

By decommenting the setTimeout lines, when the modal window has finished closing, a new one is open; however, this is not a good workaround, as the time to wait might vary (500ms works fine on my Simulator, for example, while 200ms fails).

Comments

  1. Davide Cassenti 2013-03-19

    Another note: the same error appears if you try to open the window inside a 'close' event.
  2. Lee Morris 2017-03-20

    Closing ticket as invalid.

JSON Source