This commit is contained in:
Will McGugan
2023-01-31 12:43:07 +01:00
parent bfa586fdcd
commit 330db5fc80

View File

@@ -0,0 +1,26 @@
from textual.app import App, ComposeResult
from textual.containers import Vertical
from textual.widgets import Header, Footer, Label, Input
class InputWidthAutoApp(App[None]):
CSS = """
Screen {
align: center middle;
}
Input.auto {
width: auto;
max-width: 100%;
}
"""
def compose(self) -> ComposeResult:
yield Header()
yield Input(placeholder="This has auto width", classes="auto")
yield Footer()
if __name__ == "__main__":
InputWidthAutoApp().run()