Skip to content
Discussion options

You must be logged in to vote

Yeah, this is expected, and it comes down to width. Input's default CSS is width: 100%, so inside a Horizontal it grabs the entire row and leaves nothing for the Button. Select is different: its default is width: 1fr, which is why it shares space and the Button survives in your second row (where there's no Input competing for the whole width).

Give Input the same 1fr treatment and everything flexes together:

class Sample(App):
    CSS = """
    Input { width: 1fr; }
    """

Now Select, Input, and Button all share the row, and the Button keeps its 16-cell min-width.

On auto-sizing Select to its content: there's no content-based width for it out of the box, so set an explicit width or leave…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dAnjou
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