Skip to content

how to remove all children of a TabbedContent #5299

Answered by willmcgugan
nnako asked this question in Q&A
Discussion options

You must be logged in to vote

Things that involve modifying the DOM don't happen immediately. If you want to ensure that clear_panes is finished, you will need to make your method a coroutine (async def my_method(self):), and await the result.

i.e. If you do this, it will ensure all panes are cleared before you add new ones.

await _TabbedContent.clear_panes()

If you do that, I don't think the issue @TomJGooding linked to will apply.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@nnako
Comment options

@willmcgugan
Comment options

Answer selected by nnako
@nnako
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants