Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26338] iOS: Label not shown when opened in window from tab-group in 7.3.0 (kroll-thread only)

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-08-29T10:01:08.000+0000
Affected Version/sRelease 7.3.0
Fix Version/sRelease 7.3.1
ComponentsiOS
Labelsios
ReporterAndreas Pingas
AssigneeVijay Singh
Created2018-08-24T11:40:18.000+0000
Updated2018-08-29T10:48:31.000+0000

Description

Createlabel bug The algorithm below works properly on 7.2.1GA however on 7.3.0GA does not. The label is not created as it should be. Check the algorithm below with the setting “run on main thread” turned off.
var windowA = Ti.UI.createWindow();
var windowB = Ti.UI.createWindow();
 
var tabA = Ti.UI.createTab({
	window:windowA,
	title:'Tab A'
});
 
var tabB = Ti.UI.createTab({
	window:windowB,
	title:'Tab B'
});
	
var tabGroup = Titanium.UI.createTabGroup({
	tabs:[tabA, tabB]
});
 
tabGroup.open();

windowA.addEventListener('click', function() {
	
	var win = Titanium.UI.createWindow();
			
	win.add(Ti.UI.createLabel({
		text:'TEST',
		color:'#000'
	}));
			
	tabA.open(win);
	
});

Comments

  1. Sharif AbuDarda 2018-08-26

    Hello, I have tested your issue on our end and I was able to reproduce the issue. There seems to be an issue with running on the main thread turned off for SDK 7.3.0.GA. With the main thread set to true, there is no issue. For 7.2.x.GA there is no issue. I will forward this to our engineering. Thanks.
  2. Hans Knöchel 2018-08-26

    This is a valid issue and regression from TIMOB-17235. Assigning to [~vijaysingh] for further investigation. [~andreas.pingas] Out of interest: What blocks you from migrating to main-thread? The deprecated kroll-thread will be removed later this year, so if there are any issues with it, we should know those to fix them.
  3. Vijay Singh 2018-08-27

    This problem is happening only on kroll-thread. I'll look in this. [~andreas.pingas] You should migrate to main-thread as [~hknoechel] has suggested.
  4. Vijay Singh 2018-08-29

    PR (master) - https://github.com/appcelerator/titanium_mobile/pull/10294 PR (7_4_X) - https://github.com/appcelerator/titanium_mobile/pull/10295 PR (7_3_X) - https://github.com/appcelerator/titanium_mobile/pull/10293 Note - Please verify test cases using Kroll-thread and main-thread both. Test Case 1 (From this ticket) -
       var windowA = Ti.UI.createWindow();
       var windowB = Ti.UI.createWindow();
        
       var tabA = Ti.UI.createTab({
       	window:windowA,
       	title:'Tab A'
       });
        
       var tabB = Ti.UI.createTab({
       	window:windowB,
       	title:'Tab B'
       });
       	
       var tabGroup = Titanium.UI.createTabGroup({
       	tabs:[tabA, tabB]
       });
        
       tabGroup.open();
        
       windowA.addEventListener('click', function() {
       	
       	var win = Titanium.UI.createWindow({
       		backgroundColor: 'white'
       	});
       	var label = Ti.UI.createLabel({
       		text:'TEST',
       		color:'red',
       	})		
       	win.add(label);
       			
       	tabA.open(win);
       });
       
    Test case 2 (From TIMOB-17235) -
       Titanium.UI.setBackgroundColor('#000');
        
       // create tab group
       var tabGroup = Titanium.UI.createTabGroup();
        
        
       var win1 = Titanium.UI.createWindow({  
           title:'Tab 1',
           backgroundColor:'#fff'
       });
       var tab1 = Titanium.UI.createTab({  
           icon:'KS_nav_views.png',
           title:'Tab 1',
           window:win1
       });
        
       var label1 = Titanium.UI.createLabel({
       	color:'#999',
       	text:'I am Window 1',
       	font:{fontSize:20,fontFamily:'Helvetica Neue'},
       	textAlign:'center',
       	bottom:10
       });
        
       win1.add(label1);
        
       // create base UI tab and root window
       
       var win2 = Titanium.UI.createWindow({  
           title:'Tab 1',
           backgroundColor:'#fff'
       });
       var tab2 = Titanium.UI.createTab({  
           icon:'KS_nav_views.png',
           title:'Tab 2',
           window:win2
       });
        
       var label2 = Titanium.UI.createLabel({
       	color:'#999',
       	text:'I am Window 2',
       	font:{fontSize:20,fontFamily:'Helvetica Neue'},
       	textAlign:'center',
       	bottom:10
       });
        
       win2.add(label2);
        
       var win3 = Titanium.UI.createWindow({  
           title:'Tab 1',
           backgroundColor:'#fff'
       });
       var tab3 = Titanium.UI.createTab({  
           icon:'KS_nav_views.png',
           title:'Tab 1',
           window:win3
       });
        
       var label3 = Titanium.UI.createLabel({
       	color:'#999',
       	text:'I am Window 1',
       	font:{fontSize:20,fontFamily:'Helvetica Neue'},
       	textAlign:'center',
       	width:'auto'
       });
        
       win3.add(label3);
        
       // create base UI tab and root window
       
       var win4 = Titanium.UI.createWindow({  
           title:'Tab 1',
           backgroundColor:'#fff'
       });
       var tab4 = Titanium.UI.createTab({  
           icon:'KS_nav_views.png',
           title:'Tab 1',
           window:win4
       });
        
       var label4 = Titanium.UI.createLabel({
       	color:'#999',
       	text:'I am Window 1',
       	font:{fontSize:20,fontFamily:'Helvetica Neue'},
       	textAlign:'center',
       	width:'auto'
       });
        
       win4.add(label4);
        
       //  add tabs
       tabGroup.addTab(tab1);  
       tabGroup.addTab(tab2);  
       tabGroup.addTab(tab3);
       tabGroup.addTab(tab4);
        
       tabGroup.open();
       
  5. Samir Mohammed 2018-08-29

    Verified fix in SDK version 7.3.1.v20180829001917 and 7.4.0.v20180829013317 *Test Steps (FR Passed):*

    Created a new Titanium application

    Added the first test case in to the app

    Ran the app with “run on main thread” turned off.

    Clicked in to Tab A

    Able to see the label

    Ran the app again but this time with “run on main thread” turned on.

    Clicked in to Tab A

    Still able to see the label

    Created an application with the second test case

    Ran the program

    Able to see no flickering

    *Test environment*
       APPC Studio:  5.1.0.201808080937
       APPC CLI: 7.0.6-Master.5
       iphone 6 simulator (11.2)
       Operating System Name: Mac OS High Sierra
       Operating System Version: 10.13.6
       Node.js Version: 8.9.1
       Xcode 10.0 beta 6
       
    *Note:* Waiting for build on Master.
  6. Samir Mohammed 2018-08-29

    *Closing ticket.* Verified fix in SDK version 7.5.0.v20180829030547 using the test steps above.

JSON Source