bakerac4 / glimmer-native

77 stars 5 forks source link

RadListView item template nodes duplicated when rendering null values #32

Open billdami opened 5 years ago

billdami commented 5 years ago

In a simple vertical linear list view layout, it appears that the item templates for a RadListView will incorrectly render duplicate values/view nodes across multiple items in the list, if the node is given a null value.

For example, if the item template contains the following:

<Label text={{@item.name}}  />

Where some of the members in the backing data list contain null for @item.name, those particular items are rendering a non-null value from another member in the list. This seems to happen due to that <Label> node being recycled incorrectly.

However, if you modify the template to the following:

<Label text={{if @item.name @item.name ""}}  />

So that null/empty values instead pass an empty string to the <Label>, the issue does not occur.