Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15412] Focus events stops working when you create and open a new window before opening of tabgroup

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.1.3, Release 3.1.4
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterKi Song
AssigneeUnknown
Created2013-10-03T21:50:01.000+0000
Updated2018-02-28T20:03:11.000+0000

Description

Problem Description

I have test this issue with provided test code. I got this bug. When I clicked on tab its not firing focus event. But when I removed playerWindow.open() its working well. It’s working well for 3.1.2 GA and 3.1.1 GA.

Test case

function ApplicationTabGroup(Window) {
	//create module instance
	var self = Ti.UI.createTabGroup();

	var topWindow = Ti.UI.createWindow({
		width : '100%',
	});
	//create app tabs
	var win1 = new Window(L('home')), win2 = new Window(L('settings'));

	var tab1 = Ti.UI.createTab({
		title : L('home'),
		icon : '/images/KS_nav_ui.png',
		window : win1
	});
	win1.containingTab = tab1;

	var tab2 = Ti.UI.createTab({
		title : L('settings'),
		icon : '/images/KS_nav_views.png',
		window : win2
	});
	win2.containingTab = tab2;

	self.addTab(tab1);
	self.addTab(tab2);

	self.addEventListener('open', function(e) {

		var playerWindow = Ti.UI.createWindow({
			width : '100%',
			height : 150,
			bottom : 0,
			backgroundColor : '#e5e5e5',
			visible : false,
			layout : 'vertical',
			zIndex : 100
		});
		playerWindow.open();
	});
	tab1.addEventListener('focus', function(e) {
		alert('1 Focus');
	});

	tab2.addEventListener('focus', function(e) {
		alert('2 Focus - this should fire, but it does not');
	});

	return self;
};

module.exports = ApplicationTabGroup;

Steps to reproduce*

1. Create default tabbed application in Titanium Classic 2. Open ApplicationTabGroup.js file and replace with my test code 3. Run this apps 4. Click on settings tab, focus event not firing 5. Now change Ti SDK 3.1.3 GA to 3.1.2 GA 6. Continue step 3 to 4 7. Remove playerWindow.open(); script form test code and follow step 6

Attachments

FileDateSize
app.js2013-10-07T14:50:43.000+0000753

Comments

  1. Ki Song 2013-10-07

    Test Case
  2. Ki Song 2013-10-07

    It doesn't work on the latest 3.1.4.v20131002082601 SDK either.
  3. Shameer Jan 2014-09-04

    Issue exist with TiSDK 3.1.3.GA and 3.4.0 Appcelerator Studio, build: 3.3.0.201407111535 iOS 7.1

JSON Source