[TIMOB-24181] Parity: ListItem properties set to undefined/null have inconsistent results on iOS and Android
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-05-17T22:09:59.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.1.0 |
Components | TiAPI |
Labels | parity |
Reporter | Shawn Lan |
Assignee | Joshua Quick |
Created | 2016-03-12T02:01:10.000+0000 |
Updated | 2017-05-17T22:34:30.000+0000 |
Description
index.xml
<Alloy>
<Window class="container">
<ListView defaultItemTemplate="template">
<Templates>
<ItemTemplate name="template" accessoryType="Ti.UI.LIST_ACCESSORY_TYPE_DISCLOSURE" backgroundColor="red">
<Label bindId="title" />
</ItemTemplate>
</Templates>
<ListSection id="listsection1" />
</ListView>
</Window>
</Alloy>
index.js
$.index.open();
var listitem = {
properties:{
accessoryType: undefined,
backgroundColor:undefined
},
title:{text:'List Item Title'}
};
$.listsection1.setItems([listitem]);
On iOS, the properties fall back to the values set in the template. On Android, the properties fall back to the default values.
This is inconvenient for cross-platform development.
SDK 5.5.1.GA, 6.0.0.GA This is reproducible by the following classic app:
So the expected result is that android falls back to the values set in the template right?
master: https://github.com/appcelerator/titanium_mobile/pull/8670 6_1_0: https://github.com/appcelerator/titanium_mobile/pull/9017
FAILED FR with this environment: Node Version: 6.10.1 NPM Version: 3.10.10 Mac OS: 10.12.4 Appc CLI: 6.2.0 Appc CLI NPM: 4.2.9 Titanium SDK versions: 6.1.0, 6.2.0 locally built (on appropriate branch) Appcelerator Studio, build: 4.8.1.201612050850 Xcode 8.3.2 Android device 6.0.1 iOS Device 10.3 On iOS device, the background of the Title is red as expected. On the Android device it is black. Per the ticket, it should be red. I tested the demo code in the PR (classic version) and the Alloy version in the ticket.
Verified fix in 6.2.0.v20170517150008 and 6.1.0.v20170517143931. Test and other information can be found at: Master: https://github.com/appcelerator/titanium_mobile/pull/8670 6_1_X: https://github.com/appcelerator/titanium_mobile/pull/9017