Skip to content

Error in count of TodoMVC example #524

Closed
@imjared

Description

@imjared

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:

  1. Load TodoMVC example
  2. Add a few items to your todo list. Note that the counter properly increments (mine is at 4)
  3. Mark one item as complete. Note that the counter properly decrements (mine is at 3)
  4. 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)
  5. Click "clear completed." You should still have the correct number of items displaying. (mine is at 3)
  6. Go back to the "all" view. Add a new item to the list.

Expected result:

  1. 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

  1. 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. image
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions