Skip to content

Commit

Permalink
fix check
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed May 23, 2024
1 parent 4e83677 commit c7c9a6e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/textual/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -1123,10 +1123,11 @@ async def recompose(self) -> None:
Recomposing will remove children and call `self.compose` again to remount.
"""
async with self.batch():
await self.query("*").exclude(".-textual-system").remove()
if self._is_linked_to_app:
await self.mount_all(compose(self))
if self._parent is not None:
async with self.batch():
await self.query("*").exclude(".-textual-system").remove()
if self._is_linked_to_app:
await self.mount_all(compose(self))

def _post_register(self, app: App) -> None:
"""Called when the instance is registered.
Expand Down

0 comments on commit c7c9a6e

Please sign in to comment.