mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
24 lines
611 B
Python
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()
|