Text wrap issue with auto width #6015
-
yes
yes The bug
I'm not sure if this is expected behavior: I tried rendering a long line of text (wider than the screen) inside a Static widget, with CSS set to When I commented out from textual.app import App, ComposeResult
from textual.containers import Vertical
from textual.widgets import Static
class AutoWidthApp(App):
CSS = """
Vertical {
border: solid red;
Static {
border: solid green;
width: auto;
text-wrap: wrap;
}
}
"""
def compose(self) -> ComposeResult:
long_text = "This is a long text. " * 50
with Vertical():
yield Static(
long_text,
id="note",
)
if __name__ == "__main__":
app = AutoWidthApp()
app.run() Screenshots![]()
![]() comment out Textual DiagnosticsVersions
Python
Operating System
Terminal
Rich Console options
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
When the width is auto, the widget will be sized wide enough so it doesn't need to wrap. Note how in your first screenshot, the green border is cropped. If you set PS If you are not certain if it is a bug, it is best to open a discussion. |
Beta Was this translation helpful? Give feedback.
When the width is auto, the widget will be sized wide enough so it doesn't need to wrap.
Note how in your first screenshot, the green border is cropped. If you set
overflow: auto
on your container, you would be able to scroll to the end of it.PS If you are not certain if it is a bug, it is best to open a discussion.