Skip to content
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

bug in Container.updateChildren special cases for a.length == 1 and b.length == 1 with implicit keys #5

Closed
mraleph opened this issue Mar 14, 2015 · 2 comments

Comments

@mraleph
Copy link

mraleph commented Mar 14, 2015

In both special cases for a.length == 1 here and b.length == 1 here we can perform an update on the last node and exit the loop. At this point i == b.length (or i == a.length depending on the special case in question) because we already incremented i. The code after the loop assumes that this means no update was performed and aNode has to be removed (or bNode should be inserted). Which leads to incorrect DOM update - we either lose DOM node or we get duplicated node.

I can send you a PR if you'd like that fixes the problem.

localvoid added a commit that referenced this issue Mar 14, 2015
@localvoid
Copy link
Owner

Thanks, fixed.

@mraleph
Copy link
Author

mraleph commented Mar 15, 2015

I upgraded and confirmed that the issue is gone. Awesome, thanks!

@mraleph mraleph closed this as completed Mar 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants