Repository: holoviz/panel

Issue:
EditableFloatSlider, EditableIntSlider, EditableRangeSlider in reference example working strangely and raising errors
I'm on the current master branch of Panel and the FloatSlider is not working as expected.

https://mybinder.org/v2/gh/holoviz/panel/binder?urlpath=lab/tree/examples/reference/widgets/EditableFloatSlider.ipynb

If I 

- drag the slider
- keep the mouse pressed 
- release the mouse

I see sometimes see the slider jumping around when mouse is pressed and always an error message when released.

https://user-images.githubusercontent.com/42288570/115104174-03d20a00-9f57-11eb-9750-675741011be6.mp4

```bash
Traceback (most recent call last):
  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/pyviz_comms/__init__.py", line 325, in _handle_msg
    self._on_msg(msg)
  File "/home/jovyan/panel/viewable.py", line 261, in _on_msg
    doc.unhold()
  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/bokeh/document/document.py", line 669, in unhold
    self._trigger_on_change(event)
  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/bokeh/document/document.py", line 1180, in _trigger_on_change
    self._with_self_as_curdoc(event.callback_invoker)
  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/bokeh/document/document.py", line 1198, in _with_self_as_curdoc
    return f()
  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/bokeh/util/callback_manager.py", line 161, in invoke
    callback(attr, old, new)
  File "/home/jovyan/panel/reactive.py", line 278, in _comm_change
    self._process_events({attr: new})
  File "/home/jovyan/panel/reactive.py", line 250, in _process_events
    self.param.set_param(**self._process_property_change(events))
  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/param/parameterized.py", line 1472, in set_param
    self_._batch_call_watchers()
  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/param/parameterized.py", line 1611, in _batch_call_watchers
    self_._execute_watcher(watcher, events)
  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/param/parameterized.py", line 1573, in _execute_watcher
    watcher.fn(*args, **kwargs)
  File "/home/jovyan/panel/widgets/slider.py", line 538, in _sync_value
    self.param.set_param(**{event.name: event.new})
  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/param/parameterized.py", line 1465, in set_param
    setattr(self_or_cls, k, v)
  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/param/parameterized.py", line 316, in _f
    instance_param.__set__(obj, val)
  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/param/parameterized.py", line 318, in _f
    return f(self, obj, val)
  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/param/__init__.py", line 623, in __set__
    super(Dynamic,self).__set__(obj,val)
  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/param/parameterized.py", line 318, in _f
    return f(self, obj, val)
  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/param/parameterized.py", line 909, in __set__
    raise TypeError("Constant parameter '%s' cannot be modified"%self.name)
TypeError: Constant parameter 'value_throttled' cannot be modified
```




Discussion:
Same behaviour for EditableIntSlider

![image](https://user-images.githubusercontent.com/42288570/115104232-527fa400-9f57-11eb-847e-4705a35c18bb.png)

Same behaviour for EditableRangeSlider

![image](https://user-images.githubusercontent.com/42288570/115104252-6aefbe80-9f57-11eb-8a06-100f0edb1bdc.png)

Properly related to #2085. 

Resolving patch:
diff --git a/panel/widgets/slider.py b/panel/widgets/slider.py
--- a/panel/widgets/slider.py
+++ b/panel/widgets/slider.py
@@ -468,25 +468,25 @@ def __init__(self, **params):
         super().__init__(**params)
         self._label = StaticText(margin=0, align='end')
         self._slider = self._slider_widget(
-            margin=(0, 0, 5, 0), sizing_mode='stretch_width'
+            value=self.value, margin=(0, 0, 5, 0), sizing_mode='stretch_width'
         )
-        self._slider.param.watch(self._sync_value, ['value', 'value_throttled'])
+        self._slider.param.watch(self._sync_value, 'value')
+        self._slider.param.watch(self._sync_value, 'value_throttled')
+
         self._value_edit = self._input_widget(
             margin=0, align='end', css_classes=['slider-edit']
         )
-        label = Row(self._label, self._value_edit)
-        self._composite.extend([label, self._slider])
-        self._slider.jscallback(args={'value': self._value_edit}, value="""
-        value.value = cb_obj.value
-        """)
+        self._value_edit.param.watch(self._sync_value, 'value')
+        self._value_edit.param.watch(self._sync_value, 'value_throttled')
         self._value_edit.jscallback(args={'slider': self._slider}, value="""
-        if (cb_obj.value < slider.start) {
+        if (cb_obj.value < slider.start)
           slider.start = cb_obj.value
-        } else if (cb_obj.value > slider.end) {
+        else if (cb_obj.value > slider.end)
           slider.end = cb_obj.value
-        }
-        slider.value = cb_obj.value
         """)
+
+        label = Row(self._label, self._value_edit)
+        self._composite.extend([label, self._slider])
         self._update_editable()
         self._update_layout()
         self._update_name()
@@ -535,8 +535,8 @@ def _update_value(self):
         self._value_edit.value = self.value
 
     def _sync_value(self, event):
-        self.param.set_param(**{event.name: event.new})
-
+        with param.edit_constant(self):
+            self.param.set_param(**{event.name: event.new})
 
 
 class EditableFloatSlider(_EditableContinuousSlider, FloatSlider):
@@ -585,11 +585,15 @@ def __init__(self, **params):
         super().__init__(**params)
         self._label = StaticText(margin=0, align='end')
         self._slider = RangeSlider(margin=(0, 0, 5, 0), show_value=False)
-        self._slider.param.watch(self._sync_value, ['value', 'value_throttled'])
+        self._slider.param.watch(self._sync_value, 'value')
+        self._slider.param.watch(self._sync_value, 'value_throttled')
         self._start_edit = FloatInput(min_width=50, margin=0, format=self.format,
                                       css_classes=['slider-edit'])
         self._end_edit = FloatInput(min_width=50, margin=(0, 0, 0, 10), format=self.format,
                                     css_classes=['slider-edit'])
+        self._start_edit.param.watch(self._sync_start_value, 'value_throttled')
+        self._end_edit.param.watch(self._sync_end_value, 'value_throttled')
+
         sep = StaticText(value='...', margin=(0, 2, 0, 2), align='end')
         edit = Row(self._label, self._start_edit, sep, self._end_edit,
                    sizing_mode='stretch_width', margin=0)
@@ -668,4 +672,17 @@ def _update_value(self):
         self._end_edit.value = self.value[1]
 
     def _sync_value(self, event):
-        self.param.set_param(**{event.name: event.new})
+        with param.edit_constant(self):
+            self.param.set_param(**{event.name: event.new})
+
+    def _sync_start_value(self, event):
+        with param.edit_constant(self):
+            self.param.set_param(
+                **{event.name: (event.new, self.value_throttled[1])}
+            )
+
+    def _sync_end_value(self, event):
+        with param.edit_constant(self):
+            self.param.set_param(
+                **{event.name: (self.value_throttled[0], event.new)}
+            )


Test patch: