Skip to content
Discussion options

You must be logged in to vote

Sure, there's a few different ways you could do it; looks like you're getting the idea now. For example:

from textual import on
from textual.app import App, ComposeResult
from textual.containers import Vertical
from textual.widgets import Select, Input


class ShowHideExampleApp(App[None]):
    CSS = """
    Input.show-hide {
        display: none;
    }

    Input.show-hide.visible {
        display: block;
    }
    """

    def compose(self) -> ComposeResult:
        with Vertical():
            yield Select((("Option A", "a"), ("Option B", "b")))
            yield Input("You selected A", classes="show-hide", id="option-a")
            yield Input("You selected B", classes="show-hide", id

Replies: 1 comment 12 replies

Comment options

You must be logged in to vote
12 replies
@davep
Comment options

@Tim-Cao
Comment options

@Tim-Cao
Comment options

@davep
Comment options

Answer selected by Tim-Cao
@Tim-Cao
Comment options

@davep
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants