-
Notifications
You must be signed in to change notification settings - Fork 818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TextLog
with wrap
set to True
causes layout issues for the rest of the display
#1554
Comments
davep
added a commit
to davep/textual-sandbox
that referenced
this issue
Jan 12, 2023
I can also reproduce with the following (enter text in the first box then focus or tab to the next): from textual.app import ComposeResult
from textual.containers import Container, Horizontal
from textual.screen import Screen
from textual.widget import Widget
from textual.widgets import Button, Footer, Header, Input, Label, TextLog
class LabeledInput(Horizontal):
DEFAULT_CSS = """
LabeledInput {
height: 3;
}
LabeledInput Label {
margin-top: 1;
width: 1fr;
text-align: right;
}
LabeledInput Input {
width: 5fr;
}
"""
class ConfigurationInput(Widget):
DEFAULT_CSS = """
ConfigurationInput Button {
margin: 1;
width: 100%;
}
ConfigurationInput TextLog {
margin: 1;
height: 40%;
}
"""
def compose(self) -> ComposeResult:
yield LabeledInput(Label('Repo name:'), Input())
yield LabeledInput(Label('Repo path:'), Input())
yield TextLog()
class Configure(Screen):
def compose(self) -> ComposeResult:
yield Header()
yield Footer()
yield ConfigurationInput()
def on_input_changed(self, event: Input.Changed) -> None:
text_log = self.query_one(TextLog)
text_log.clear()
text_log.write('\n'.join(str(i) * 50 for i in range(50)) + '\n') # No bug without trailing new line |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Take this code:
It's designed to fake a chat app that one of our Discord members has been developing, where they've been having odd layout problems. To use the test app, run it up, hit tab to focus a pane, and then spam l to log some text to the focused
TextLog
.At that point you should have something akin to this:
At that point the display is fine. However, if you tab to the next pane...
I've also found that, often, when logging more and more items in a
TextLog
with this, as it scrolls itself as new text is added, sometimes the final character on some lines becomes "sticky".The text was updated successfully, but these errors were encountered: