New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How should foreach binding deal with items mid-animation when updating afterwards #1256
Conversation
One option that will at least prevent the strangeness in the example would be to remove extra content on each update. (This made me think of #716.) |
I'm seeing the same issues anytime the array is rerendered (renderTemplateForEach) while I first learned about this from this post in the Greensock forum: Next I found issue #943, but it was closed, saying to look at the example at http://knockoutjs.com/examples/animatedTransitions.html While that example "works", it can also produce this error in a number of ways, as shown in this fiddle: http://jsfiddle.net/WinstonF/8k8V5/2264/ (forked from RPN's fiddle: http://jsfiddle.net/rniemeyer/8k8V5/) It seems like fixing this would require us to treat deleted items that have a Any suggestions? |
…by beforeRemove should be retained in their present position until actually removed from the DOM.
I've worked on a fix for this problem, which I've attached to this issue. The fixed version can be seen demonstrated here: http://jsfiddle.net/mbest/8k8V5/2734/ |
The fix is to have the |
@rniemeyer, Can you take a look at this and give me your thoughts? |
@mbest - sure, will probably be early next week, but happy to take a look |
How should foreach binding deal with items mid-animation when updating afterwards
@mbest - great fix. works very well. |
Thanks! |
From: http://stackoverflow.com/q/14828688/1287183
When adding an item while the
beforeRemove
animation is running, the removed element is moved to the bottom of the list instead of staying in its position until the animation has finished and the element is removed.Fiddle: http://jsfiddle.net/bPP5Q/8/