Small issue that I can't quite seem to wrap my head around. I have a grocery app that I'm developing for a project, users can add and remove items to their grocery list, as usual. When a user deletes an item from their grocery list, it checks against a predefined list to see if it's a perishable item and asks if they would like to add it to another list, with an expiry date, so that they can better track items that may be close to expiring and plan to use accordingly.
The issue is that when I remove more than one item from the perishables list, I get a the below error;
This only seems to happen when perishable_date_picker is set to .Day, if I set it to .Text for example, it removes the line item without an issue.
I can see from the Do It that the 'Index in list' block has a value of 3 if I have 3 items currently on the list, but if I remove 1, the Do It shows that the value drops to 0. This clearly causes the error for when I remove more than one item from the list, but I'm unsure as to why.
it looks like you are trying to remove some item from a list, but this list does not contain this item.
Make sure the item is in this list before removing it.
I'm pretty confident the item is on the list, unless the way that I'm calling it is incorrect? Though, the issue arises when I delete more than one item from the list so it works to a point.
I can see that this is the case with the solution that Ramon provided, though I'm a little perplexed as to why it happens. Especicially when changing the format to something else allows it to work fine.