rust-webplatform / rust-todomvc

Rust implementation of TodoMVC + Emscripten
http://rust-webplatform.github.io/rust-todomvc/
242 stars 13 forks source link

The filtered views behave incorrectly. #2

Open zenoamaro opened 8 years ago

zenoamaro commented 8 years ago

When checking items while in a filtered view (ie. "active"), an action that would get an item filtered out sometimes brings back a different item instead.

I didn't investigate further, but this looks like an index or possibly event binding mismatch.

How to reproduce:

tcr commented 8 years ago

Ah, this is an easy one. I filter the list before generating the template: https://github.com/tcr/rust-todomvc/blob/master/src/main.rs#L101

I actually should just be checking that in a if statement, because the id parameter is married to the list entry's iteration in the loop. Hence you're toggling the 0th entry each time, but in the true list, not the visible one.

Thanks for the heads up @zenoamaro!