[TIMOB-27626] Android: TableView allowsSelection(true) property does not keep the row highlighted
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2019-11-27T11:25:08.000+0000 |
Affected Version/s | Release 6.1.0, Release 7.0.0, Release 8.0.0, Release 8.3.0 |
Fix Version/s | n/a |
Components | Android |
Labels | 6.1.0, 8.3.0, allowsSelection, android, highlightedColor, tableview |
Reporter | Sohail Saddique |
Assignee | Yordan Banev |
Created | 2019-11-25T15:49:31.000+0000 |
Updated | 2019-11-27T11:25:56.000+0000 |
Description
First reported as a regression in SDK 6.1.0. Regression still exists in latest SDK build. Note that this issue only affects Android. It works as intended on iOS.
When using
TableView
with allowsSelection
set to true
and rows containing labels with highlightedColor
property, the row does not stay highlighted upon selection.
Test Code:
var createRow = function (title) {
var row = Ti.UI.createTableViewRow({
accessibilityLabel: title,
className: 'test',
height: 80,
selectedBackgroundColor: '#ff0000'
});
var titleLabel = Ti.UI.createLabel({
accessibilityLabel: title,
font: {
fontFamily: 'Helvetica-Bold',
fontSize: 20
},
height: 24,
highlightedColor: '#fff',
left: 10,
text: title,
touchEnabled: false
});
row.add(titleLabel);
return row;
};
var tableData = [];
for (var i = 0, l = 100; i < l; i++) {
var row = createRow('Row Index # ' + i);
tableData.push(row);
}
var tableView = Ti.UI.createTableView({
accessibilityLabel: 'TableView_35',
allowsSelection: true,
data: tableData,
rowHeight: 80,
top: 0
});
win.add(tableView);
win.open();
*Test steps*
- Create new classic app
- Copy the code above into app.js
- Run the app
- Click on a random row
- Row will flash red
*Expected result*
Row should stay highlighted and should only become de-highlighted when another row is selected.
*Note (unexpected result)*
If you long-press a row, you will notice that the text label color stays the same, irregardless of the highlightedColor
property.
Closing both this and the related ticket as Invalid, since the property is an iOS only.
Looks like we should close both tickets. Upon further investigation, the highlightedColor property is indeed not working as intended on Android. I'll create a ticket for this.