Open dbogatz opened 2 years ago
Also somewhat weird:
If I have two foreach on my page only the first one will be affected.
I've got a table component which duplicates lines for no reason. My component life cycle looks like your example. I'm happy you was able to pinpoint the issue in a simple example.
By the way, your demo link is broken in the issue description.
Thx, I fixed the link in my description and I try to avoid valueHasMutated
for now on.
In my project it was used to trigger some computed's who access other changed non-observable data; it seems to put them in an observable too would be a good choice anyway.
I think this will be fixed with c41c1c3547c5cc7d884c47b0db95dc414b65e763, but I'll double check.
See: https://codepen.io/coyer/pen/zYRRqyo?editors=1010
HTML:
Script:
Expected Output after 300ms: "cat", "dog", "mice", "bird" but is "cat", "dog", "mice", "bird", "mice", "bird"
But works with "ko.options.deferUpdates = false;" or without "vm.key.valueHasMutated();" before setting new list or new list has same length as old list.
Anyway - thanks for the good job on knockout!