State is not sync in x-for #1400
Replies: 5 comments
-
I guess DOM is not updated correctly if I load DOM elements from array, |
Beta Was this translation helpful? Give feedback.
-
Do you have a demo online? It seems to work for me like this: https://codepen.io/KevinBatdorf/pen/MWjqGJp |
Beta Was this translation helpful? Give feedback.
-
Yeah, it works for the first time on rendering. |
Beta Was this translation helpful? Give feedback.
-
bandicam.2021-01-11.09-04-52-386.mp4Please check this out
I guess this is all about DOM re-render when state is updated |
Beta Was this translation helpful? Give feedback.
-
@ponyjackal Can you provide a codesandbox link? |
Beta Was this translation helpful? Give feedback.
-
I have two arrays in my scope
{
pets: [],
filteredPets:[]
}
Once I update filteredPets = pets.filter(...)
I get correct filteredPets,
but if I use x-for to print filteredPets, it prints pets, not filteredPets, but the length is filteredPets.length
Beta Was this translation helpful? Give feedback.
All reactions