Skip to content
Discussion options

You must be logged in to vote

Can confirm what you're seeing, and as best as I can tell after a very quick test, it might be down to some logic somewhere treating a node as a boolean value. Compare this code:

from textual.app        import App, ComposeResult
from textual.binding    import Binding
from textual.containers import Vertical
from textual.widgets    import Header, Footer, ListView, Input

class MyListView(ListView):

    BINDINGS = [
        Binding( "i", "input", "Focus Input" ),
    ]

    def action_input(self) -> None:
        self.app.bell()
        self.app.query_one( Input ).focus()

class LVFocusApp( App[ None ] ):

    CSS = """
    MyListView {
        height: 1fr;
        border: solid blue;
    }

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@TomJGooding
Comment options

TomJGooding Apr 11, 2023
Collaborator Author

@davep
Comment options

Answer selected by davep
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