My app has a listview connected to a variable called billableItems.
billableIetms looks like this:
On top of the listview, I have a button that adds a new object to billableItems (and therefore, a new row to the listview). This button works as intended. See image below:
The problem happens when I try to delete one of the rows from the listview. The red trash button on the right of each row is supposed to delete the appropriate object on the billableItems array, and the listview should be updated accordingly.
To do so, I have the following query, attached to the click event of the button:
The variable is updated correctly, but the listview is not.
Suppose I have three rows with descriptions: "a", "b", and "c".
If I delete the first element, I get the following:
The row with the description "a" should be gone, it is "c" that disappeared, which is wrong. Oddly enough, the variable has been updated correctly:
Is this a well-known issue? How can I solve it?