When I try to animate the removal of an item from a data model, the item gets removed, but apparently because the animation I am using sets the item's dimensions to 0, the next item added to the data model is not visible. To see it, I have to reload the entire data model, or close and re-open my app. If I don't do the animation, items are removed and added correctly, just not with the effect I'm trying to achieve. My sample code is as follows:
ListView {
dataModel: GroupDataModel {
id: noteDataModel
}
listItemComponents: [
ListItemComponent {
type: "item"
StandardListItem {
id: noteItem
title: ListItemData.noteTitle
description: ListItemData.noteText
animations: [
ScaleTransition {
id: deleteAnimation
toY: 0
toX: 0
duration: 500
onEnded: {
noteItem.ListItem.view.dataModel.remove(noteItem.ListItem.view.dataModel.data(noteItem.ListItem.indexPath));
}
}
]
contextActions: [
ActionSet {
DeleteActionItem {
onTriggered: {
deleteAnimation.play();
}
}
}
]
}