-
Notifications
You must be signed in to change notification settings - Fork 248
ng-repeat fails after reordering collection #1154
Comments
I would say this might be linked to #1097 but not if this is reproducible on master |
Thanks for the clean repro, however I can not reproduce this on master. What are the steps to get the bug on master w/ Dart ? |
I was just clicking on the "random" button several times. It happens once in 3-5 cases. On version from pub it sometimes loses some rows and leads to complete disaster. On version from master it is much better, only order is sometimes incorrect. |
The linked issue explain the pb on the pub version. I'll take a look at the master issue (I was not paying attention to the indexes but I can reproduce it now) |
I've checked it and on compiled version is even worse. After indexes are in wrong order next shufle makes some rows disappear. Also: |
@lavep pub version ? if yes this is expected as stated above. @michalpie I have now a simplified version of your code and a good idea of what could go wrong. I hope I can come with a fix quickly. |
Great! Thank you, Victor. |
@vicb yes I've tried it on all versions from 0.10 to git |
I have the fix, I need to write a test and I'll push the PR |
Could you please test the PR and report your results. Thanks. |
It works fine on Dartium. @lavep has tested the compiled version and it works fine as well. Victor, thank you very much for this quick fix, you were unbelievably fast! |
no pb. Your code really helped me. |
Hi Victor, |
0.13 will focus on perf. The best would be to wait until 0.14 which will include several bug fixes. I hope it can be released in about 1 month |
We found a bug when using ng-repeat over a collection of objects. If the collection is reordered several times, ng-repeat looses or duplicates some elements, also the $index property is not showing consecutive numbers. Tested with AngularDart 0.12.0 from pub and the newest version from git master. The bug present in Dartium and in compiled version.
Example program:
index.html
bugs.dart
After running the program, initially we have the correct output:
After several clicks on the "random" button, the collection is reordered, however ng-repeat shows different order of elements and invalid values of $index
Adding or removing 'track by' has no effect.
The text was updated successfully, but these errors were encountered: