-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Children nodes are inserted to new parent without first removing them from their old parent #4182
Comments
While I am at it, I'll check the whole code for |
Yes, it is. Alternatively, we can solve it by adding more logic in I can change the solution. |
I'm for more logic inside |
PJ is too:
|
Fix: View and model nodes will now be removed from their old parents when they are added to a new parent to prevent having same node on multiple elements' children lists. Closes #1139. BREAKING CHANGE: View and model nodes are now automatically removed from their old parents when they are inserted into new elements. This is important e.g. if you iterate through element's children and they are moved during that iteration. In that case, it's safest to cache the element's children in an array.
I spotted a bug that crashed editor during rendering. It appeared that
Renderer
wants to re-render a part of a tree that is detached from main tree. What was weird about that tree was that detached-root had a child but that child'sparent
property was set tonull
. Similarly, that child also had a child which also hadparent
set tonull
.After debugging it appeared that in
view.Writer
some nodes were supposed to be moved from one node to another, however those nodes were not removed from their original parent before appending to new parent, which caused this bug.The text was updated successfully, but these errors were encountered: