Description
The index property of a tableview click event is in relation to the tableviewsection, it should be in relation to the entirety of the tableview
var win = Ti.UI.createWindow();
var sectionFruit = Ti.UI.createTableViewSection({ headerTitle: 'Fruit' });
sectionFruit.add(Ti.UI.createTableViewRow({ title: 'Apples' }));
sectionFruit.add(Ti.UI.createTableViewRow({ title: 'Bananas' }));
var sectionVeg = Ti.UI.createTableViewSection({ headerTitle: 'Vegetables' });
sectionVeg.add(Ti.UI.createTableViewRow({ title: 'Carrots' }));
sectionVeg.add(Ti.UI.createTableViewRow({ title: 'Potatoes' }));
var table = Ti.UI.createTableView({
data: [sectionFruit, sectionVeg]
});
table.addEventListener('click', function (e) {
alert(e.index);
});
win.add(table);
win.open();
Steps to reproduce
Add the above to an existing app.js and build for Windows
Click Row 10 in section 2
Actual
Row 0 in Section 1 gets updated
Expected
Row 10 in section 2 should be updated
https://github.com/appcelerator/titanium_mobile_windows/pull/1144
Changes are seen in 7.0.0.v20171115153702.