Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1791] Android: Titanium.UI.Tab onFocus and onBlur events are fired twice

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-03-06T20:57:57.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
Reporterankur garha
AssigneeMauro Parra-Miranda
Created2013-01-09T03:14:55.000+0000
Updated2016-03-08T07:40:41.000+0000

Description

*Problem description* The onFocus and onBlur events of a TabGroup tab are fired twice on Android only. *Test case*
var tabGroup = Ti.UI.createTabGroup();

var tab1 = Ti.UI.createTab({
	title : 'Tab 1',
	icon : 'KS_nav_ui.png',
	window : Ti.UI.createWindow({
		title : 'Tab 1',
		backgroundColor : '#fff'
	})
});

var tab2 = Ti.UI.createTab({
	title : 'Tab 2',
	icon : 'KS_nav_views.png',
	window : Ti.UI.createWindow({
		title : 'Tab 2',
		backgroundColor : '#fff'
	})
});

tabGroup.addTab(tab1);
tabGroup.addTab(tab2);

tab1.addEventListener('focus', function(e) {
	Ti.API.info("client info tab got focus");
});
tab1.addEventListener('blur', function(e) {
	Ti.API.info("client info tab lost focus");
});

tabGroup.open();
*Log*
client info tab got focus
client info tab got focus
client info tab lost focus
client info tab lost focus

Comments

  1. Daniel Sefton 2013-01-09

    I cannot reproduce this, what Android version are you using?

JSON Source