Skip to content

Commit 1faebe3

Browse files
committed
Enforce Slider value bounds
1 parent 7192eec commit 1faebe3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

panel/widgets/slider.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ 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+
112116

113117
class ContinuousSlider(_SliderBase):
114118

@@ -891,6 +895,10 @@ def __init__(self, **params):
891895
self._update_value()
892896
self._update_bounds()
893897

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+
894902
def _validate_init_bounds(self, params):
895903
"""
896904
This updates the default value, start and end

0 commit comments

Comments
 (0)