Closed nnmm closed 1 year ago
I should add that this used to work, it only stopped working when I upgraded from version 0.9.1 to 0.10.1.
Confirmed on 0.10.1. Testing with main
(as of 2023-02-06) I get a different result: rather than a hang I get a crash with this error:
NoMatches: No nodes match <DOMQuery Header() filter='HeaderTitle'>
I see what is going on. When the new screen mounts, the header calls watch
which checks all the watchers. This invokes a watcher on the screen that has just been removed, and by the time it is handled it's DOM is empty.
Don't forget to star the repository!
Follow @textualizeio for Textual updates.
Description
If I call
self.app.switch_screen()
, the app hangs and needs two Ctrl-C presses to fully stop.Here is an example app – press "A", then "B". You'll see that screen B is not shown and the app hangs.
Screen A is only there because I wanted to make sure that it was not because I was switching the root screen.
If I replace the
switch_screen()
withpush_screen()
, screen B is shown as expected.Textual Diagnostics
Versions
Python
Operating System
Terminal
Rich Console options