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

Setting loading to True causes widgets to overwrite notifications #3677

Closed
davep opened this issue Nov 14, 2023 · 3 comments · Fixed by #3683
Closed

Setting loading to True causes widgets to overwrite notifications #3677

davep opened this issue Nov 14, 2023 · 3 comments · Fixed by #3683
Assignees
Labels
bug Something isn't working Task

Comments

@davep
Copy link
Contributor

davep commented Nov 14, 2023

Given this code:

from textual.app import App, ComposeResult
from textual.widgets import Label

class LoadingOverlayApp(App[None]):

    CSS = """
    Label {
        width: 90%;
        height: 1fr;
        text-align: center;
        border: solid red;
    }
    """

    def compose(self) -> ComposeResult:
        yield Label("This is a really big label")

    def on_mount(self) -> None:
        self.notify(
            "This is a really big notification. Loading should not overwrite it.",
            timeout=9_999_999
        )
        self.query_one(Label).loading = True

if __name__ == "__main__":
    LoadingOverlayApp().run()

you get this result:

Screenshot 2023-11-14 at 15 32 15

a widget in loading=True state shouldn't appear to overwrite notifications.

@davep davep added bug Something isn't working Task labels Nov 14, 2023
davep added a commit to davep/textual-sandbox that referenced this issue Nov 14, 2023
@davep
Copy link
Contributor Author

davep commented Nov 15, 2023

As previously requested, tagging @willmcgugan on something that should probably TODO sooner rather than later.

@rodrigogiraoserrao rodrigogiraoserrao self-assigned this Nov 15, 2023
@rodrigogiraoserrao
Copy link
Contributor

Here's another interesting one:
if you set a scrollable container to load, you can still scroll, it'll show content that was past the current scrolling position, and the loading indicator overlay will move around as well:

Screen.Recording.2023-11-15.at.11.37.44.mov

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
bug Something isn't working Task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants