[TIMOB-1535] Android: TabGroup focus event args refer to previous tab, not current tab
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2011-04-15T02:55:21.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.0 M05 |
Components | Android |
Labels | android, defect, tabGroup, tabgroup |
Reporter | Bill Dawson |
Assignee | Don Thorp |
Created | 2011-04-15T02:55:20.000+0000 |
Updated | 2017-03-03T05:58:20.000+0000 |
Description
Also, tabGroup.activeTab.title returns undefined.
Test case:
Titanium.UI.setBackgroundColor('#000');
var tabGroup = Titanium.UI.createTabGroup();
for (var i = 0; i < 4; i++) {
var win = Ti.UI.createWindow({
title: 'Tab ' + i,
backgroundColor: '#fff'
});
var tab = Ti.UI.createTab({
title: 'Tab ' + i,
window: win
});
tabGroup.addTab(tab);
}
tabGroup.addEventListener('focus', function(e) {
Ti.API.info('index: ' + e.index);
Ti.API.info('previousIndex: ' + e.previousIndex);
Ti.API.info('previousTab.title: ' + e.previousTab.title);
Ti.API.info('tab.title: ' + e.tab.title);
Ti.API.info('tabGroup.activeTab.title: ' + tabGroup.activeTab.title);
});
tabGroup.open();
After the app launches, click Tab 1 and you'll see the info output in the console refers to Tab 0.
This looks to be a duplicate of #2071, which should now be resolved (minus the setActiveTab bug which I'll be merging the fix for soon)
Closing issue due to time passed and irrelevance of the ticket.