Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose widgets visible property #2065

Merged
merged 1 commit into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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