[TIMOB-19353] iOS - ListView - data update changes item's delete state
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Shawn Lan |
Assignee | Unknown |
Created | 2015-07-17T01:36:17.000+0000 |
Updated | 2018-02-28T19:55:53.000+0000 |
Description
When a listview item is in delete state (that is, the item is swiped left and a red delete button shows on the right), if updating the listview data, the item with delete state goes back to normal state. This is a weird behavior. Preferably data update doesn't change an item's delete state. Is this a bug? Or any reason for such behavior?
To reproduce, create an Alloy default project with the following:
index.xml
<Alloy>
<Window class="container">
<ListView>
<ListSection id="list">
<ListItem title="List item 1" canEdit="true"></ListItem>
<ListItem title="List item 2" canEdit="true"></ListItem>
<ListItem title="List item 3" canEdit="true"></ListItem>
</ListSection>
</ListView>
</Window>
</Alloy>
index.js
$.index.open();
setInterval(function(){$.list.updateItemAt(0,{properties:{title:Date.now()}});},1000);
Swipe left on any item to show the delete button and see how it goes back to normal state every time the data is updated.
[~shawnlan] can you please add a test case here? Thanks!
Updated the description with the test case. Turns out it's not related to Alloy data binding. As long as you update the listview's data, you'll have this issue.
The updated item and the item in delete state can be different ones.