Description
When calling insertRowBefore with a row that has been taken from the table, not a dictionary or a newly created row, the application appears to freeze
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[e.index];
Ti.API.info('index');
Ti.API.info(e.index);
Ti.API.info(row.title);
table.insertRowBefore(0, row);
});
_window.open();
Steps to reproduce
Add the code above to an existing app.js
Build for Windows Platform
Tap a row
Actual result
Application appears to freeze on the row click
Expected result
A duplicate of the row clicked should be added to the top of the tableview
https://github.com/appcelerator/titanium_mobile_windows/pull/939
Verified fixed with the test code provided in the description, was able to verify that a new row is added to the top of the tableview when an existing row is clicked. The screenshot below shows that rows are added to the top of the table view when clicking on a row. (Shows before and after clicking on random rows) !Before.PNG|thumbnail! !6.1.0.v20170206114448.PNG|thumbnail! *Environment*