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

Fix RangeSlider value_start/value_end readonly #2468

Merged
merged 1 commit into from
Jun 30, 2021
Merged
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
15 changes: 8 additions & 7 deletions panel/widgets/slider.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,9 @@ class _RangeSliderBase(_SliderBase):

value = param.Tuple(length=2)

value_start = param.Parameter()
value_start = param.Parameter(readonly=True)

value_end = param.Parameter()
value_end = param.Parameter(readonly=True)

__abstract = True

Expand All @@ -369,7 +369,8 @@ def __init__(self, **params):
params['value'] = (params.get('start', self.start),
params.get('end', self.end))
params['value_start'], params['value_end'] = params['value']
super().__init__(**params)
with edit_readonly(self):
super().__init__(**params)

@param.depends('value', watch=True)
def _sync_values(self):
Expand All @@ -393,9 +394,9 @@ class RangeSlider(_RangeSliderBase):

value = param.Range(default=(0, 1))

value_start = param.Number(default=0, constant=True)
value_start = param.Number(default=0, readonly=True)

value_end = param.Number(default=1, constant=True)
value_end = param.Number(default=1, readonly=True)

value_throttled = param.Range(default=None, constant=True)

Expand Down Expand Up @@ -440,9 +441,9 @@ class DateRangeSlider(_RangeSliderBase):

value = param.Tuple(default=(None, None), length=2)

value_start = param.Date(default=None)
value_start = param.Date(default=None, readonly=True)

value_end = param.Date(default=None)
value_end = param.Date(default=None, readonly=True)

value_throttled = param.Tuple(default=None, length=2, constant=True)

Expand Down