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

Visibility rule doesn't impact children #1313

Closed
willmcgugan opened this issue Dec 4, 2022 · 1 comment · Fixed by #1327
Closed

Visibility rule doesn't impact children #1313

willmcgugan opened this issue Dec 4, 2022 · 1 comment · Fixed by #1327

Comments

@willmcgugan
Copy link
Collaborator

Applying visibility: hidden to a container, makes the container hidden, but not the children.

Pretty sure browser CSS would also make the children hidden, so we should replicate that functionality.

The follow example demonstrates the issue:

from textual.app import App, ComposeResult

from textual.widget import Widget
from textual.widgets import Static


class VisApp(App):

    CSS = """
    #container {
        border: solid red;
        visibility: hidden;
    }
    """

    def compose(self) -> ComposeResult:
        yield Widget(
            Static("foo"),
            Static("bar"),
            id="container",
        )


if __name__ == "__main__":
    app = VisApp()
    app.run()

With the above, both foo and bar are visible, while the container is not.

@github-actions
Copy link

github-actions bot commented Dec 7, 2022

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