Skip to content

Commit

Permalink
[collapsible]: Don't allow selection of children while closed (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
bczsalba committed Feb 24, 2024
1 parent 58b6b7c commit 337e780
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pytermgui/widgets/collapsible.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ def __init__(

self._is_expanded = False

@property
def selectables(self) -> list[tuple[Widget, int]]:
if self._is_expanded:
return super().selectables

return [(self.trigger, 0)]

def toggle(self) -> Collapsible:
"""Toggles expanded state.
Expand Down

0 comments on commit 337e780

Please sign in to comment.