Files
textual/tests/snapshot_tests/snapshot_apps/scroll_visible.py
Will McGugan 5c514b0dab scroll visible snapshot (#2225)
* scroll visible snapshot

* change text of test
2023-04-06 11:13:09 +01:00

24 lines
611 B
Python

from textual.app import App, ComposeResult
from textual.containers import VerticalScroll
from textual.widgets import Label, Static
# Checks https://github.com/Textualize/textual/issues/2181
class MyCustomWidget(Static):
def compose(self) -> ComposeResult:
yield Label(("|\n" * 100)[:-1])
yield Label("SHOULD BE VISIBLE", id="target")
class MyApp(App):
def compose(self) -> ComposeResult:
with VerticalScroll():
yield MyCustomWidget()
def key_t(self) -> None:
self.query_one("#target").scroll_visible()
if __name__ == "__main__":
MyApp().run()