Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resuming a Screen navigated through binding key does not show refreshed screen #5542

Closed
otf31 opened this issue Feb 16, 2025 · 2 comments · Fixed by #5543
Closed

Resuming a Screen navigated through binding key does not show refreshed screen #5542

otf31 opened this issue Feb 16, 2025 · 2 comments · Fixed by #5543

Comments

@otf31
Copy link

otf31 commented Feb 16, 2025

The bug

After upgrading to Textual 2.0, screen widgets are not showing correctly after pushing a Screen or ModalScreen through a bind key, the first push action is fine and then the problem is shown.

Hovering the screen's widgets with the cursor show those widgets.

Example

from textual.app import App, ComposeResult
from textual.screen import Screen
from textual.widgets import Header, Footer, Label, Button


class Screen1(Screen):
    def compose(self) -> ComposeResult:
        yield Button("Back", action="app.pop_screen")
        yield Label("Screen 1")


class BugApp(App[None]):
    SCREENS = {"screen1": Screen1}
    BINDINGS = {("s", "push_screen('screen1')", "Screen 1")}

    def compose(self) -> ComposeResult:
        yield Header()
        yield Label("Bug app")
        yield Footer()


if __name__ == "__main__":
    app = BugApp()

    app.run()
output.mov

Textual Diagnostics

Versions

Name Value
Textual 2.0.1
Rich 13.9.4

Python

Name Value
Version 3.13.1
Implementation CPython
Compiler GCC 14.2.1 20240910
Executable /home/otf31/Desktop/bugapp/.venv/bin/python

Operating System

Name Value
System Linux
Release 6.13.2-arch1-1
Version #1 SMP PREEMPT_DYNAMIC Sat, 08 Feb 2025 18:54:55 +0000

Terminal

Name Value
Terminal Application Unknown
TERM xterm-256color
COLORTERM truecolor
FORCE_COLOR Not set
NO_COLOR Not set

Rich Console options

Name Value
size width=150, height=39
legacy_windows False
min_width 1
max_width 150
is_terminal True
encoding utf-8
max_height 39
justify None
overflow None
no_wrap False
highlight None
markup None
height None
Copy link

We found the following entries in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

@otf31 otf31 changed the title Resuming a screen navigated through binding key does not show refreshed screen Resuming a Screen navigated through binding key does not show refreshed screen Feb 16, 2025
Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant