[TIMOB-1536] Android: TabGroup.activeTab returns index when should be tab object, AND index is wrong
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:56:27.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.6.0 M01 |
Components | Android |
Labels | android, defect, release-1.6.0, tabGroup, tabgroup |
Reporter | Bill Dawson |
Assignee | Don Thorp |
Created | 2011-04-15T02:55:21.000+0000 |
Updated | 2011-04-17T01:56:27.000+0000 |
Description
Test case app.js:
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('tabGroup.activeTab: ' + tabGroup.activeTab);
Ti.API.info('tabGroup.activeTab.title: ' + tabGroup.activeTab.title);
});
tabGroup.open();
tabGroup.activeTab will return index of the previous tab you were on, not the activeTab. In fact, according to our docs, it should return the tab object of the current tab.
(from [0ebb6cb682acafca9b062a649c9708a0ff5aa034]) Merge branch 'master' of https://github.com/dizzymonkey/titanium_mobile">https://github.com/dizzymonkey/titanium_mobile [#1536 state:fixed-in-qa] https://github.com/appcelerator/titanium_mobile/commit/0ebb6cb682acafca9b062a649c9708a0ff5aa034"> https://github.com/appcelerator/titanium_mobile/commit/0ebb6cb682ac...
G2 - 2.2.1, G1 - 1.6 emulator 2.1 Titanium SDK version: 1.6.0 (01/06/11 08:47 8b2fd0e). verified correct behavior on iOS 4gt ipod touch