Skip to content

Commit

Permalink
expose widgets visible property (#2065)
Browse files Browse the repository at this point in the history
Co-authored-by: ARTUSI <xavier.artusi@cea.fr>
  • Loading branch information
xavArtley and ARTUSI committed Mar 10, 2021
1 parent 3dfcb7d commit ddf974d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions panel/tests/test_reactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,12 @@ def test_text_input_controls():
assert len(controls) == 2
wb1, wb2 = controls
assert isinstance(wb1, WidgetBox)
assert len(wb1) == 6
name, disabled, *(ws) = wb1
assert len(wb1) == 7
name, disabled, visible, *(ws) = wb1

assert isinstance(name, StaticText)
assert isinstance(disabled, Checkbox)
assert isinstance(visible, Checkbox)

not_checked = []
for w in ws:
Expand Down
3 changes: 3 additions & 0 deletions panel/widgets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class Widget(Reactive):
disabled = param.Boolean(default=False, doc="""
Whether the widget is disabled.""")

visible = param.Boolean(default=True, doc="""
Whether the widget is visible or not.""")

name = param.String(default='')

height = param.Integer(default=None, bounds=(0, None))
Expand Down

0 comments on commit ddf974d

Please sign in to comment.