Skip to content

Commit

Permalink
expose widgets visible property
Browse files Browse the repository at this point in the history
  • Loading branch information
ARTUSI committed Mar 9, 2021
1 parent c816ad0 commit 714a147
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion panel/tests/test_reactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_text_input_controls():
assert len(controls) == 2
wb1, wb2 = controls
assert isinstance(wb1, WidgetBox)
assert len(wb1) == 6
assert len(wb1) == 7
name, disabled, *(ws) = wb1

assert isinstance(name, StaticText)
Expand All @@ -113,6 +113,8 @@ def test_text_input_controls():
assert w.value == "Test placeholder..."
elif w.name == 'Max length':
assert isinstance(w, IntInput)
elif w.name == 'Visible':
assert isinstance(w, Checkbox)
else:
not_checked.append(w)

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 714a147

Please sign in to comment.