Skip to content
Discussion options

You must be logged in to vote

You should probably explain why you want to do this, as it feels like an odd requirement.

However, any of these solutions should work:

  • Replace the Collapsible as well.
  • Add a ContentSwitcher inside the Collapsible, put your content in there.
  • Put another container inside the switcher, and replace the content in that.

The reason it is breaking, is because the Collapsible has children of its own, and you are removing them.

I think this will remove all the children.

await self.query_one("Collapsible Content").remove_children()

However I would consider the other solutions first.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@tibor95
Comment options

@tibor95
Comment options

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