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
Remove a specific component from the container #145
Comments
Interesting. We worked around this in our own projects by wrapping the elements which need to be removed into another row/column. This group can then be cleared individually. Another approach is to not remove the elements but simply change their visibility to But there may be cases where both approaches are not ideal. We need to investigate this further. Do you think we need have a |
I thought about Anyway, adding a row without any gap/margin as a workaround should be good enough, thank you! |
I added a The operation is not very efficient in terms of bandwidth, since the whole container is sent to the client with the one element missing. But it should be handy in some situations nonetheless. (In version 1.0 will will probably support manipulating the DOM without re-transmitting the whole subtree again and again.) |
By the way: Like |
Thank you. How do I remove the references? Consider:
Are there any references to the label object? In this code there is none; are there any inside NiceGUI? |
No, NiceGUI doesn't keep references to UI elements. But if you would assign elements to global variables or add them to a list, for example, you would need to get rid of them after calling You're right: In your example there are no references to the label kept. So the GC can automatically remove it. |
@falkoschindler I see that in Although in JustPy it's similar: |
@me21 Thanks for pointing this out! The behavior is indeed inconsistent. I will have a closer look. |
This issue is fix since NiceGUI 1.0. |
There is a method called clear which removes the children of a container. But is there a way to remove the specific child component?
In addition, this method removes JustPy objects, but does it remove corresponding NiceGUI wrappers?
The text was updated successfully, but these errors were encountered: