[TIMOB-8019] MobileWeb : Window - Calling open on an already opened window causes the app to become non-responsive
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-03-15T12:03:26.000+0000 |
Affected Version/s | Release 2.0.0 |
Fix Version/s | Release 2.0.0, Sprint 2012-06 |
Components | MobileWeb |
Labels | qe-mw020912, qe-port |
Reporter | Michael Pettiford |
Assignee | Bryan Hughes |
Created | 2012-03-14T15:38:39.000+0000 |
Updated | 2012-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
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.
Just for clarification purposes, the bug was on our end but was in the modal code, not the open code.
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