You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd love to send a PR for this one since I'm just getting my feet wet but it might take me a bit so I'll defer to people smarter :)
To reproduce:
Load TodoMVC example
Add a few items to your todo list. Note that the counter properly increments (mine is at 4)
Mark one item as complete. Note that the counter properly decrements (mine is at 3)
Toggle the view to show only completed tasks. Note the counter still correctly shows the number of items left on your list. (mine is at 3)
Click "clear completed." You should still have the correct number of items displaying. (mine is at 3)
Go back to the "all" view. Add a new item to the list.
Expected result:
The list should grow in length with the item I just added at the top. The counter of "items left" should increment by one
Actual result
My item is added to the top but the last item on the list disappears. The counter of "items left" has incremented by one but only three items are visible.
Adding new items after this will grow the list as expected but the Todo that disappeared will remain gone. The counter of "items left" still accounts for the missing Todo.
There's some additional funk on the counter that occurs if you remove an item from the list while it's in this incremented state. I can file more of a bug report if needed but I have a hunch that resolving this problem will resolve the latter issue.
The text was updated successfully, but these errors were encountered:
This is happening because the newly added task has the same id as the previous task. This is because the todos reducer is simply assigning state.length as id when a new task is added.
I think the solution is to keep some increment-only part (like nextId) in the state or just use big UUIDs.
I'd love to send a PR for this one since I'm just getting my feet wet but it might take me a bit so I'll defer to people smarter :)
To reproduce:
Expected result:
Actual result
There's some additional funk on the counter that occurs if you remove an item from the list while it's in this incremented state. I can file more of a bug report if needed but I have a hunch that resolving this problem will resolve the latter issue.
The text was updated successfully, but these errors were encountered: