Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Commit

Permalink
✨ Add a tester for Textualize/textual#4242
Browse files Browse the repository at this point in the history
  • Loading branch information
davep committed Mar 14, 2024
1 parent 8485ba9 commit 8f2c651
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions scroll_through_disabled.py
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

0 comments on commit 8f2c651

Please sign in to comment.