diff --git a/tests/snapshot_tests/snapshot_apps/auto_width_input.py b/tests/snapshot_tests/snapshot_apps/auto_width_input.py new file mode 100644 index 000000000..aafffaf8d --- /dev/null +++ b/tests/snapshot_tests/snapshot_apps/auto_width_input.py @@ -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()