Description
When running the code below and clicking any headerview other than Label0 the row will not be made visible. When clicking Label0 the row in that section is made visible
function formRow(isVisible, rowHeight){
var row = Ti.UI.createTableViewRow({
width : Ti.UI.FILL,
height : rowHeight,
backgroundColor : "white"
});
row.add(Ti.UI.createLabel({
text : "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
color: "black",
height : Ti.UI.SIZE,
visible : isVisible,
width : Ti.UI.FILL,
}));
return row;
}
function formHeaderView(index){
var headerView = Titanium.UI.createView({
layout : "vertical",
height : 55,
width : Ti.UI.FILL
});
var headerContentView = Titanium.UI.createView({
backgroundColor : "white",
height : 44,
sectionIndex : index,
width : Ti.UI.FILL,
touchEnabled : true
});
var headerLabel = Titanium.UI.createLabel({
text : "Label" + index,
left : 0,
color : "black",
touchEnabled : false,
height : Ti.UI.SIZE
});
headerView.addEventListener('click', function(e){
Ti.API.info('header view click:::::::::::::::'+JSON.stringify(e));
table.updateRow(e.source.sectionIndex, formRow(true,Ti.UI.SIZE));
});
headerContentView.add(headerLabel);
headerView.add(headerContentView);
return headerView;
}
Ti.UI.backgroundColor = 'white';
var win = Ti.UI.createWindow();
var listSections = [];
for (var i = 0; i < 5; i++) {
var section = Ti.UI.createTableViewSection({
headerView : formHeaderView(i)
});
section.add(formRow(false, 0));
listSections.push(section);
}
var table = Ti.UI.createTableView({
data: listSections
});
win.add(table);
win.open();
Steps to reproduce
1. Add the code above to an existing app.js and build to Android
2. Click
Label0
3. Click
Label1
Actual
Row is shown when clicking Label0, is not when click Label1
Expected
Row should show in both cases
master: https://github.com/appcelerator/titanium_mobile/pull/12558
FR Passed.
merged to master; 10_0_X for 10.0.0 target; and 9_3_X branch.