Description
When calling insertRow with an existing row, if the row has been deleted then the application will freeze and error out, this code works fine on Android, need to check iOS
var _window = Ti.UI.createWindow();
var table = Ti.UI.createTableView({
top: 0,
bottom: 0
});
var tableData = [];
for (var i = 0; i < 10; i++) {
tableData.push(Ti.UI.createTableViewRow({
title: "Row " + (i + 1)
}));
}
table.setData(tableData);
_window.add(table);
table.addEventListener("click", function(e) {
var row = table.data[0].rows[e.index];
Ti.API.info('index');
Ti.API.info(e.index);
Ti.API.info(row.title);
console.log('delete row');
table.deleteRow(row);
console.log('insertRow');
table.insertRowBefore(0, row);
});
_window.open();
Steps to reproduce
Add the code above to an application
Build for Windows
Tap a row
Actual
Application freezes and errors out
Expected
Application should not freeze or error out,
This works fine on iOS.
https://github.com/appcelerator/titanium_mobile_windows/pull/1164
Closing ticket; Verified fix in SDK Version: 7.1.0.v20180228160738 and SDK Version: 7.2.0.v20180301101144.