This repository has been archived by the owner on Jun 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Add a tester for Textualize/textual#4242
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"""Test scrolling through disabled widgets.""" | ||
|
||
from textual.app import App, ComposeResult | ||
from textual.containers import VerticalScroll | ||
from textual.widgets import Placeholder | ||
|
||
|
||
class ScrollThroughDisabledApp(App[None]): | ||
CSS = """ | ||
Placeholder { | ||
height: 10; | ||
margin: 1 2; | ||
&:disabled { | ||
opacity: 0.3; | ||
} | ||
} | ||
""" | ||
|
||
def compose(self) -> ComposeResult: | ||
with VerticalScroll(): | ||
for n in range(100): | ||
yield (placeholder := Placeholder()) | ||
placeholder.disabled = bool(n % 2) | ||
|
||
|
||
if __name__ == "__main__": | ||
ScrollThroughDisabledApp().run() | ||
|
||
### scroll_through_disabled.py ends here |