Skip to content

Commit 25d2440

Browse files
committed
Implement correctly for different subclasses
1 parent 1faebe3 commit 25d2440

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

panel/widgets/slider.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,6 @@ def _process_events(self, events: dict[str, Any]) -> None:
109109
events.pop("value", None)
110110
super()._process_events(events)
111111

112-
@param.depends('start', 'end', watch=True, on_init=True)
113-
def _sync_bounds(self):
114-
self.param.value.bounds = (self.start, self.end)
115-
116112

117113
class ContinuousSlider(_SliderBase):
118114

@@ -128,6 +124,10 @@ def __init__(self, **params):
128124
params['value'] = params.get('start', self.start)
129125
super().__init__(**params)
130126

127+
@param.depends('start', 'end', watch=True, on_init=True)
128+
def _sync_bounds(self):
129+
self.param.value.bounds = (self.start, self.end)
130+
131131
def _get_embed_state(self, root, values=None, max_opts=3):
132132
ref = root.ref['id']
133133
w_model, parent = self._models[ref]
@@ -305,6 +305,10 @@ def __init__(self, **params):
305305
params['value'] = params.get('start', self.start)
306306
super().__init__(**params)
307307

308+
@param.depends('start', 'end', watch=True, on_init=True)
309+
def _sync_bounds(self):
310+
self.param.value.bounds = (self.start, self.end)
311+
308312
def _process_param_change(self, msg):
309313
msg = super()._process_param_change(msg)
310314
if 'value' in msg:
@@ -590,6 +594,10 @@ def __init__(self, **params):
590594
with edit_readonly(self):
591595
super().__init__(**params)
592596

597+
@param.depends('start', 'end', watch=True, on_init=True)
598+
def _sync_bounds(self):
599+
self.param.value.bounds = (self.start, self.end)
600+
593601
@param.depends('value', watch=True)
594602
def _sync_values(self):
595603
vs, ve = self.value
@@ -895,10 +903,6 @@ def __init__(self, **params):
895903
self._update_value()
896904
self._update_bounds()
897905

898-
@param.depends('start', 'end', watch=True, on_init=True)
899-
def _sync_bounds(self):
900-
self.param.value.bounds = (self.fixed_start, self.fixed_end)
901-
902906
def _validate_init_bounds(self, params):
903907
"""
904908
This updates the default value, start and end

0 commit comments

Comments
 (0)