-
-
Notifications
You must be signed in to change notification settings - Fork 370
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
Update html.go #767
base: master
Are you sure you want to change the base?
Update html.go #767
Conversation
Render child component which is created outside Render() method.
I tested this with our projects and did not find any problems. It does in fact fix misc variants of this problem. And I hope that it can be merged asap if @maxence-charriere does not see a problem with it! |
@maxence-charriere would you be so nice as to give your opinion on this topic? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That loop within is hard to read/understand for me.
So it seems that:
- for each child already mounted, it looks if b is already here
- then if its the case, the found element is swapped with the current children
- the component is not updated because it is itself
How does this solve the order problem? The node is switched on the Go side but I don't see anything done on the DOM side.
Phew, I thought it was just me :) All I know is that this fixes the problem with this type of coding. Without "this" fix, Go-App is acting very strange, which is why I think this may qualify as a real bug, and there needs to be a resolution. |
I agree. I was thinking about this before releasing the latest version. I got some ideas. Just need to experiment a bit. |
Let a= [b1,b2,b3,b4] |
Issues #759 has a unit test. |
@gepengscu That makes a lot of sense. Having ranges like that should probably introduce an invisible offset to aid in correctly updating the elements. I also do not like that mounting the same type over an existing one is just updating the nodes (my "mount point" problem). Probably one should be able to make components of the same type unique to force swaps instead of overwriting. Which feels like a similar yet other problem. |
The key is that go-app changed fields value of ui object owend by Go side when update.That will be a problem when ui is not created in render method dynamicaly. |
Will there be any updates to this? |
@maxence-charriere Will there be any updates to this? |
Allow rendering child component which is created outside Render() method.