diff --git a/src/textual/screen.py b/src/textual/screen.py index 9f065dfbf..5cec44b88 100644 --- a/src/textual/screen.py +++ b/src/textual/screen.py @@ -666,6 +666,8 @@ class Screen(Generic[ScreenResultType], Widget): """Screen has resumed.""" self.stack_updates += 1 size = self.app.size + self._refresh_layout(size, full=True) + self.refresh() if self.AUTO_FOCUS is not None and self.focused is None: try: focus_candidates = self.query(self.AUTO_FOCUS) @@ -676,8 +678,6 @@ class Screen(Generic[ScreenResultType], Widget): if widget.focusable: self.set_focus(widget) break - self._refresh_layout(size, full=True) - self.refresh() def _on_screen_suspend(self) -> None: """Screen has suspended.""" diff --git a/tests/snapshot_tests/test_snapshots.py b/tests/snapshot_tests/test_snapshots.py index ea5e32153..d70fc761e 100644 --- a/tests/snapshot_tests/test_snapshots.py +++ b/tests/snapshot_tests/test_snapshots.py @@ -203,9 +203,11 @@ def test_option_list(snap_compare): assert snap_compare(WIDGET_EXAMPLES_DIR / "option_list_options.py") assert snap_compare(WIDGET_EXAMPLES_DIR / "option_list_tables.py") + def test_option_list_build(snap_compare): assert snap_compare(SNAPSHOT_APPS_DIR / "option_list.py") + def test_progress_bar_indeterminate(snap_compare): assert snap_compare(WIDGET_EXAMPLES_DIR / "progress_bar_isolated_.py", press=["f"]) @@ -440,7 +442,7 @@ def test_modal_dialog_bindings_input(snap_compare): # Check https://github.com/Textualize/textual/issues/2194 assert snap_compare( SNAPSHOT_APPS_DIR / "modal_screen_bindings.py", - press=["enter", "tab", "h", "!", "left", "i", "tab"], + press=["enter", "h", "!", "left", "i", "tab"], )