File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -1419,7 +1419,7 @@ def _validate_theme(self, theme_name: str) -> str:
14191419 raise InvalidThemeError (message )
14201420 return theme_name
14211421
1422- def _watch_theme (self , theme_name : str ) -> None :
1422+ async def _watch_theme (self , theme_name : str ) -> None :
14231423 """Apply a theme to the application.
14241424
14251425 This method is called when the theme reactive attribute is set.
Original file line number Diff line number Diff line change @@ -4654,3 +4654,25 @@ def compose(self) -> ComposeResult:
46544654 yield TextArea (placeholder = TEXT )
46554655
46564656 assert snap_compare (PlaceholderApp ())
4657+
4658+
4659+ def test_rich_log_early_write (snap_compare ) -> None :
4660+ """Regression test for https://github.com/Textualize/textual/issues/6123
4661+
4662+ You should see a RichLog with "Hello World" text
4663+
4664+ """
4665+
4666+ class TestApp (App ):
4667+ def compose (self ) -> ComposeResult :
4668+ with Horizontal ():
4669+ yield RichLog ()
4670+
4671+ def on_mount (self ) -> None :
4672+ self .theme = "nord"
4673+
4674+ def on_ready (self ) -> None :
4675+ log_widget = self .query_one (RichLog )
4676+ log_widget .write ("Hello, World!" )
4677+
4678+ assert snap_compare (TestApp ())
You can’t perform that action at this time.
0 commit comments