Skip to content

Commit 948577f

Browse files
committed
Enforce Slider value bounds
1 parent 1c65a19 commit 948577f

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
@@ -108,6 +108,10 @@ def _process_events(self, events: dict[str, Any]) -> None:
108108
events.pop("value", None)
109109
super()._process_events(events)
110110

111+
@param.depends('start', 'end', watch=True, on_init=True)
112+
def _sync_bounds(self):
113+
self.param.value.bounds = (self.start, self.end)
114+
111115

112116
class ContinuousSlider(_SliderBase):
113117

@@ -890,6 +894,10 @@ def __init__(self, **params):
890894
self._update_value()
891895
self._update_bounds()
892896

897+
@param.depends('start', 'end', watch=True, on_init=True)
898+
def _sync_bounds(self):
899+
self.param.value.bounds = (self.fixed_start, self.fixed_end)
900+
893901
def _validate_init_bounds(self, params):
894902
"""
895903
This updates the default value, start and end

0 commit comments

Comments
 (0)