mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
scroll visible snapshot (#2225)
* scroll visible snapshot * change text of test
This commit is contained in:
File diff suppressed because one or more lines are too long
23
tests/snapshot_tests/snapshot_apps/scroll_visible.py
Normal file
23
tests/snapshot_tests/snapshot_apps/scroll_visible.py
Normal file
@@ -0,0 +1,23 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user