[TIMOB-25936] iOS: TableView: Appending row immediately after a section appends them before the section
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-04-06T21:13:15.000+0000 |
Affected Version/s | Release 7.1.0 |
Fix Version/s | Release 7.1.1 |
Components | iOS |
Labels | mainthread, qe-7.1.0 |
Reporter | Eric Wieber |
Assignee | Hans Knöchel |
Created | 2018-04-05T18:20:53.000+0000 |
Updated | 2018-04-06T22:37:47.000+0000 |
Description
In a TableView, when appending a row immediately after appending a section, the elements appear in the reverse order (row and then section).
*Steps to reproduce issue*:
1. Create a classic app with the below code
2. Run the app
*Expected Results*:
Each section has 3 rows under it
*Actual Results*:
All of the rows appear first, then the sections
*Notes*:
In the example, you can click on the window to add another section and row that also appear in reverse order.
var win = Ti.UI.createWindow({ backgroundColor: "#f00" });
var table = Ti.UI.createTableView();
for (var i = 0; i < 2; ++i) {
table.appendSection(Ti.UI.createTableViewSection({ headerTitle: "Header " + i, className: "Header" }));
for (var j = 0; j < 3; j++) {
table.appendRow(Ti.UI.createTableViewRow({ title: "Row " + j, className: "Row" }));
}
}
win.addEventListener("click", function() {
table.appendSection(Ti.UI.createTableViewSection({ headerTitle: "Title", className: "Header" }));
table.appendRow(Ti.UI.createTableViewRow({ title: "Row ", className: "Row" }));
});
win.add(table);
win.open();
PR (master): https://github.com/appcelerator/titanium_mobile/pull/9986 PR (7_1_X): https://github.com/appcelerator/titanium_mobile/pull/9987 Unit-test part of the PR, test-case above.
FR Passed. Sections and rows are appended in the correct order. Tested using the provided code as well as modifications to the project to append in different ways and/or orders.
Verified changes are in SDK builds 7.1.1.v20180406141533 & 7.2.0.v20180406141822