Skip to content

Commit

Permalink
Remove default scrollbars from Container
Browse files Browse the repository at this point in the history
As per Textualize#2361 this removes default scrollbars on Container (and so adds them
on ScrollableContainer).
  • Loading branch information
davep committed Apr 24, 2023
1 parent 8b6d902 commit 38e6369
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/textual/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,21 @@ class Container(Widget):
Container {
height: 1fr;
layout: vertical;
overflow: auto;
overflow: hidden hidden;
}
"""


class ScrollableContainer(Widget, inherit_bindings=False):
"""Base container widget that binds navigation keys for scrolling."""

DEFAULT_CSS = """
ScrollableContainer {
layout: vertical;
overflow: auto auto;
}
"""

BINDINGS: ClassVar[list[BindingType]] = [
Binding("up", "scroll_up", "Scroll Up", show=False),
Binding("down", "scroll_down", "Scroll Down", show=False),
Expand Down

0 comments on commit 38e6369

Please sign in to comment.