Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19353] iOS - ListView - data update changes item's delete state

GitHub Issuen/a
TypeBug
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterShawn Lan
AssigneeUnknown
Created2015-07-17T01:36:17.000+0000
Updated2018-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.

Comments

  1. Radamantis Torres-Lechuga 2015-07-22

    [~shawnlan] can you please add a test case here? Thanks!
  2. Shawn Lan 2015-07-31

    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.
  3. Shawn Lan 2015-08-12

    The updated item and the item in delete state can be different ones.

JSON Source