Skip to content

Commit

Permalink
Add the remove indirection back again
Browse files Browse the repository at this point in the history
See Textualize#2854 -- turns out that it's
still an issue, but on Python 3.7 but not Python 3.11 (as mentioned in the
linked issue, I've not tested other versions yet).
  • Loading branch information
davep committed Jun 28, 2023
1 parent 9c5a9c1 commit 5b5d28c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/textual/widgets/_toast.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ def __init__(

def _on_mount(self, _: Mount) -> None:
"""Set the time running once the toast is mounted."""
self.set_timer(self._timeout, self.remove)
# https://github.com/Textualize/textual/issues/2854
self.set_timer(self._timeout, self._expire)

def _expire(self) -> None:
"""Remove the toast once the timer has expired."""
# https://github.com/Textualize/textual/issues/2854
self.remove()


class Rack(Container, inherit_css=False):
Expand Down

0 comments on commit 5b5d28c

Please sign in to comment.