diff --git a/nicegui/elements/timer.py b/nicegui/elements/timer.py index 5402cbb07..ec263f81e 100644 --- a/nicegui/elements/timer.py +++ b/nicegui/elements/timer.py @@ -125,3 +125,5 @@ def _should_stop(self) -> bool: def _cleanup(self) -> None: self.callback = None + assert self.parent_slot + self.parent_slot.parent.remove(self)