Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10973] iOS 6 : Child window is not opening if parent window has modal property set to true.

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2013-09-18T16:37:40.000+0000
Affected Version/sRelease 2.1.3
Fix Version/sRelease 2.1.3, Release 3.0.0, Sprint 2012-19 API, 2012 Sprint 19
ComponentsiOS
Labelsapi, module_window, qe-ios090112, qe-ios6, qe-testadded
ReporterShyam Bhadauria
AssigneeVishal Duggal
Created2012-09-19T03:42:32.000+0000
Updated2017-03-30T17:34:15.000+0000

Description

This is not a regression. It occurs on 2.1.2 also on iOS 6 device/simulator. It works fine on iOS 5. If parent window has set 'modal:true' , then child window could not be opened from it. Steps to reproduce: 1. Use the code below in app.js
var win = Ti.UI.createWindow();
var aBtn = Ti.UI.createButton({title:'open'});
		
		aBtn.addEventListener('click', function(){
			var toplevel = Ti.UI.createWindow({backgroundColor : 'red'});
			toplevel.open(); 
		});
		
win.add(aBtn);
win.open({modal : true}); 
2. Run the app 3. Click open button. Expected result: 2. A black window with 'open' button should be displayed. 3. A red window should be displayed. Actual result: 2. A black window with 'open' button is displayed. 3. A red window do not gets displayed.Instead a warning is displayed in console. Warning message attached.

Attachments

FileDateSize
Warning message.rtf2012-09-19T03:42:32.000+0000840

Comments

  1. Vishal Duggal 2012-09-19

    Reopening to investigate further
  2. Vishal Duggal 2012-09-19

    Expanded test case
       var win = Ti.UI.createWindow();
       var aBtn = Ti.UI.createButton({title:'open modal'});
       		aBtn.addEventListener('click', function(){
                   var toplevel = Ti.UI.createWindow({backgroundColor : 'red'});
       			var bBtn = Ti.UI.createButton({title:'open regular', top:10});
       			var cBtn = Ti.UI.createButton({title:'close', top:60});
       			var dBtn = Ti.UI.createButton({title:'open Modal', top:110});
       			bBtn.addEventListener('click', function(){
       				var test = Ti.UI.createWindow({backgroundColor : 'green'});
       				var eBtn = Ti.UI.createButton({title:'close'});
       				eBtn.addEventListener('click',function(){
       					test.close();
       				});
       				test.add(eBtn);
       				test.open();
       			});
       			
       			cBtn.addEventListener('click',function(){
       					toplevel.close();
       			})
       
       			dBtn.addEventListener('click', function(){
       				var test2 = Ti.UI.createWindow({backgroundColor : 'yellow'});
       				var fBtn = Ti.UI.createButton({title:'close'});
       				fBtn.addEventListener('click',function(){
       					test2.close();
       				});
       				test2.add(fBtn);
       				test2.open({modal:true});
       			});
       			
       			toplevel.add(bBtn);
       			toplevel.add(cBtn);
       			toplevel.add(dBtn);
                   toplevel.open({modal:true}); 
               });
                
       win.add(aBtn);
       win.open(); 
       
  3. Vishal Duggal 2012-09-19

    Pull pending https://github.com/appcelerator/titanium_mobile/pull/2999
  4. Blain Hamon 2012-09-20

    Pull merged.
  5. Lokesh Choudhary 2012-09-21

    Verified the fix on: MAC OSX 10.8.1 Titanium studio : 2.1.2.201208301612 SDK version : 3.0.0.v20120921144915 xcode 4.5 built with iOS6 SDK on Ipad 3 running iOS6 & on Iphone simulator.
  6. Tamila Smolich 2012-09-21

    Tested and verified on: OS: Mac OS X Lion 10.7.4 Titanium Studio, build: 2.1.2.201208301612 Titanium SDK, build: 2.1.3.v20120921141611 Device: iPhone 4S (6.0.GM) A red window is displayed, but warning message "Trying to open a new window from within a Modal Window is unsupported" still appears in the console.
  7. Anshu Mittal 2013-07-23

    Reopening to update labels
  8. Anshu Mittal 2013-07-23

    Tested with: SDK:3.1.2.v20130718094558 Appcelerator Studio: 3.1.2.201307121651 OS: OSX 10.7.5 Device:iPadmini(ios6) Xcode: 4.6
  9. Priya Agarwal 2013-09-17

    Tested Environment: Appcelerator Studio: 3.1.3.201309132456 SDK: 3.1.3.v20130916153052 acs:1.0.6 alloy:1.2.2-cr npm:1.3.2 titanium:3.1.2 titanium-code-processo:1.0.2 OSX: 10.8.4 Xcode:5.0 GM seed Device:ipad3(v7.0),iphone4s(v7.0) This is Regression since issue does not occurs on 3.1.2.GA. Child window with no modal property(as by default it is false) is not opening when parent window has modal property set to true.
       var win = Ti.UI.createWindow();
       var aBtn = Ti.UI.createButton({title:'open modal'});
               aBtn.addEventListener('click', function(){
                   var toplevel = Ti.UI.createWindow({backgroundColor : 'red'});
                   var bBtn = Ti.UI.createButton({title:'open regular', top:10});
                   var cBtn = Ti.UI.createButton({title:'close', top:60});
                   var dBtn = Ti.UI.createButton({title:'open Modal', top:110});
                   bBtn.addEventListener('click', function(){
                       var test = Ti.UI.createWindow({backgroundColor : 'green'});
                       var eBtn = Ti.UI.createButton({title:'close'});
                       eBtn.addEventListener('click',function(){
                           test.close();
                       });
                       test.add(eBtn);
                       test.open();
                   });
                    
                   cBtn.addEventListener('click',function(){
                           toplevel.close();
                   })
        
                   dBtn.addEventListener('click', function(){
                       var test2 = Ti.UI.createWindow({backgroundColor : 'yellow'});
                       var fBtn = Ti.UI.createButton({title:'close'});
                       fBtn.addEventListener('click',function(){
                           test2.close();
                       });
                       test2.add(fBtn);
                       test2.open({modal:true});
                   });
                    
                   toplevel.add(bBtn);
                   toplevel.add(cBtn);
                   toplevel.add(dBtn);
                   toplevel.open({modal:true}); 
               });
                 
       win.add(aBtn);
       win.open(); 
       
    On Clicking "Open Regular" titled button.New Window in 3.1.2.GA is opened but with 3.1.3.v20130916153052 build does not get opened. On Clicking "Open Modal" titled button (child window with modal property true) New Window gets opened successfully for both 3.1.2.GA and 3.1.3.v20130916153052 build. Hence Reopening issue since when Child window with no modal property(as by default it is false)and parent window has modal property set as true. Child window is not opened. And when both Child window and parent window has modal property set as true.Child window is opened successfully.
  10. Lee Morris 2017-03-30

    Closing ticket as invalid.

JSON Source