Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8019] MobileWeb : Window - Calling open on an already opened window causes the app to become non-responsive

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-03-15T12:03:26.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sRelease 2.0.0, Sprint 2012-06
ComponentsMobileWeb
Labelsqe-mw020912, qe-port
ReporterMichael Pettiford
AssigneeBryan Hughes
Created2012-03-14T15:38:39.000+0000
Updated2012-08-08T16:26:23.000+0000

Description

Steps to reproduce: 1. Create a default mobile web application and change the code of app.js to the following

var _window = Titanium.UI.createWindow({
			title : 'test',
			backgroundColor : 'white'
		});

var button = Ti.UI.createButton({
			title : 'Press me'
		});
		button.addEventListener('click', function() {
			var button2 = Ti.UI.createButton({
				title : 'close'
			});
			var win = Ti.UI.createWindow({
				modal : true,
				backgroundColor : '#c96'
			});
			button2.addEventListener('click', function() {
				win.close();
			});
			win.add(button2);
			win.open();

			win.open();

		});
		_window.add(button);
_window.open();
2. Run the app 3. Press the "Press me" button 4. Press the "close" button Actual result: The app becomes non-responsive Expected result: The window closes and app is still functional

Comments

  1. Bryan Hughes 2012-03-14

    Pull Request: https://github.com/appcelerator/titanium_mobile/pull/1685 The problem was actually with setting the window to modal, not with opening it twice. The app was perfectly responsive too, technically speaking. If it weren't responsive, you would have gotten a warning from the browser indicating an unresponsive page. What had happened was setting the window to modal caused an extra, empty window to be put on top of the window in question, which covered the button thus blocking all mouse events to it.
  2. Bryan Hughes 2012-03-15

    Just for clarification purposes, the bug was on our end but was in the modal code, not the open code.
  3. Lokesh Choudhary 2012-08-08

    Tested On: Titanium studio : 2.1.1.201207271312 SDK version : 2.2.0.v20120807144112 Android 4.0.4 - default ,chrome 18.0 Iphone 4.3.5 - safari mobile Mountain lion(10.8) - chrome 21.0,safari 5.1.4,firefox 14.0.1

JSON Source