mbest / knockout-repeat

REPEAT binding for Knockout
http://mbest.github.io/knockout-repeat/
131 stars 18 forks source link

remove and removeAll breaks communication with first element of array #16

Closed skmasq closed 10 years ago

skmasq commented 10 years ago

So I have observableArray of new LineItem() instances, and when I try to use .remove(that instance) or .removeAll([all,instances,to,remove]) it removes the element(-s) and then first element of array has one way binding, i.e. if I change input nothing changes but if I change in console everything reflects on screen.

Is this some kind of specific bug to what someone has a workaround, or this is something that's need to be fixed? (If someone can point me where should put my hands on to fix this, I will be glad to do so, speed of rendering is important to what I'm doing)

I switched back to foreach for time being because of shipping deadlines.

mbest commented 10 years ago

I'll look into it. Thanks for the report.

skmasq commented 10 years ago

@mbest I'll reproduce this issue in jsFiddle tomorrow if that will help.

mbest commented 10 years ago

Yes, that will help a lot.

mbest commented 10 years ago

Any chance you can put together that example?

skmasq commented 10 years ago

Yeah, sorry I was caught up in project, I'll do it in following day.

skmasq commented 10 years ago

So I ported approx 1 = 1 in jsfiddle, but it seemed to me that I could not replicate the issue there. So, then I replaced foreach to repeat in my project and it's now magically working, it seems that I have accidentally fixed the issue, so I'll close this thread for now and if I come across this issue again I'll let you know what exactly was the root cause.