-
-
Notifications
You must be signed in to change notification settings - Fork 946
Description
Have you checked closed issues? (https://github.com/Textualize/textual/issues?q=is%3Aissue+is%3Aclosed) yes
Have you checked against the most recent version of Textual? (https://pypi.org/search/?q=textual) yes
The bug
Please give a brief but clear explanation of the issue. If you can, include a complete working example that demonstrates the bug. Check it can run without modifications.
The following simple program demonstrates oddities in rendering as the container scrolls.
from textual.app import App, ComposeResult
from textual.widgets import Input
from textual.containers import Horizontal, Vertical, VerticalScroll
class MyApp(App):
DEFAULT_CSS = """\
#my-container {
keyline: heavy blue;
Vertical {
margin: 1;
width: 1fr;
height: 3;
}
}
"""
def compose(self) -> ComposeResult:
with VerticalScroll(id="my-container"):
for i in range(10):
yield Vertical(Input(valid_empty=False, id=f"test-{i}", value="x"))
if __name__ == '__main__':
MyApp().run()
Pressing the <down> key, however, does not redraw correctly.
A mouse click in the window at that stage triggers a correct redraw. Also please note that with a Vertical height of 3, the window paints correctly every 4 keypresses. Adding one to the height means 5 keypresses are required, and so on.
textual diagnose
<!-- This is valid Markdown, please paste the following directly in to a GitHub issue -->
# Textual Diagnostics
## Versions
| Name | Value |
|---------|--------|
| Textual | 3.5.0 |
| Rich | 14.0.0 |
## Python
| Name | Value |
|----------------|---------------------------------------------------------------|
| Version | 3.12.8 |
| Implementation | CPython |
| Compiler | Clang 19.1.6 |
| Executable | /Users/sholden/Projects/Python/textual-forms/.venv/bin/python |
## Operating System
| Name | Value |
|---------|--------------------------------------------------------------------------------------------------------|
| System | Darwin |
| Release | 24.5.0 |
| Version | Darwin Kernel Version 24.5.0: Tue Apr 22 19:48:46 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T8103 |
## Terminal
| Name | Value |
|----------------------|--------------------|
| Terminal Application | iTerm.app (3.5.14) |
| TERM | rxvt |
| COLORTERM | truecolor |
| FORCE_COLOR | *Not set* |
| NO_COLOR | *Not set* |
## Rich Console options
| Name | Value |
|----------------|---------------------|
| size | width=80, height=20 |
| legacy_windows | False |
| min_width | 1 |
| max_width | 80 |
| is_terminal | False |
| encoding | utf-8 |
| max_height | 20 |
| justify | None |
| overflow | None |
| no_wrap | False |
| highlight | None |
| markup | None |
| height | None |