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
When using repeat.for on an array, and the array is (re)sorted in place, some of the rendered results are updated correctly and some are not. In the linked example one of the rows is always out of sync with the others. This does not occur if the array is replaced with the sorted version.
Expected/desired behavior:
After a resort, the rendered result in every iteration should be consistent.
The text was updated successfully, but these errors were encountered:
I think I see what's going on here- allow me to try and explain:
Running the gist and clicking "sort in place" causes the ${row} part of the template to update. Also, in rows that had to be moved (row 4 and row 3 needed to be swapped), the ${items[N]} parts of the template were updated. Rows that did not move had their ${items[N]} get out of sync. There's nothing we can do about this because there is no way to observe indexed array access without using Object.observe (deprecated) or dirty-checking. The sort and replace workaround would be my recommendation. With more details on your real scenario we might be able to provide other options.
I'm submitting a bug report
Chrome 55
Current behavior:
See https://gist.run/?id=dca097c25e9950440096048af1373b57.
When using
repeat.for
on an array, and the array is (re)sorted in place, some of the rendered results are updated correctly and some are not. In the linked example one of the rows is always out of sync with the others. This does not occur if the array is replaced with the sorted version.Expected/desired behavior:
After a resort, the rendered result in every iteration should be consistent.
The text was updated successfully, but these errors were encountered: