diff --git a/scroll_through_disabled.py b/scroll_through_disabled.py new file mode 100644 index 0000000..f5f16fa --- /dev/null +++ b/scroll_through_disabled.py @@ -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