diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3d15e661..c1adbf09 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,7 +5,8 @@
- bug fixes
- code editor: issue when middle clicking in the editor on linux
- code editor: modern js operators such as `**` not recognized
- - sliders: prevent error when `steps` is not a number, add `auto` mode for using ranges values as steps (it did not work before)
+ - sliders: prevent error when `steps` is not a number, add `auto` mode for using ranges values as steps (it did not work before)
+ - pads, range: value not initialized as an array, causing errors in some cases
## 1.25.4
diff --git a/src/client/widgets/common/widget.js b/src/client/widgets/common/widget.js
index 95bc24e6..321afb1c 100644
--- a/src/client/widgets/common/widget.js
+++ b/src/client/widgets/common/widget.js
@@ -201,6 +201,7 @@ class Widget extends EventEmitter {
this.isValueChanging = false
this.valueChangingTimeout = null
this.valueChangingQueue = {}
+ this.value = options.value
this.parsers = {}
this.parsersLocalScope = options.locals || {}
diff --git a/src/client/widgets/pads/multixy.js b/src/client/widgets/pads/multixy.js
index 0f236cf0..bc6944e8 100644
--- a/src/client/widgets/pads/multixy.js
+++ b/src/client/widgets/pads/multixy.js
@@ -87,8 +87,6 @@ module.exports = class MultiXy extends Pad {
}
- this.value = []
-
this.padsCoords = []
this.touchMap = {}
diff --git a/src/client/widgets/pads/pad.js b/src/client/widgets/pads/pad.js
index dfdf6af0..3b278654 100644
--- a/src/client/widgets/pads/pad.js
+++ b/src/client/widgets/pads/pad.js
@@ -5,7 +5,7 @@ class Pad extends Canvas {
constructor(options) {
- super({...options, html: html`
+ super({...options, value: [], html: html`
diff --git a/src/client/widgets/pads/rgb.js b/src/client/widgets/pads/rgb.js
index 5f9f54db..9576814a 100644
--- a/src/client/widgets/pads/rgb.js
+++ b/src/client/widgets/pads/rgb.js
@@ -40,7 +40,7 @@ module.exports = class Rgb extends Widget {
constructor(options) {
- super({...options, html: html``})
+ super({...options, value: [], html: html``})
this.container.classList.toggle('contains-alpha', this.getProp('alpha'))
@@ -125,8 +125,6 @@ module.exports = class Rgb extends Widget {
}
- this.value = []
-
this.hsb = {h:0,s:0,b:0}
this.setValue(initValue)
diff --git a/src/client/widgets/pads/xy.js b/src/client/widgets/pads/xy.js
index 5efeb80b..92a973b4 100644
--- a/src/client/widgets/pads/xy.js
+++ b/src/client/widgets/pads/xy.js
@@ -84,8 +84,6 @@ module.exports = class Xy extends Pad {
e.stopPropagation = true
})
- this.value = []
-
touchstate(this, {element: this.canvas})
this.active = false
diff --git a/src/client/widgets/sliders/range.js b/src/client/widgets/sliders/range.js
index 21196817..3502db51 100644
--- a/src/client/widgets/sliders/range.js
+++ b/src/client/widgets/sliders/range.js
@@ -45,7 +45,7 @@ class Range extends Fader {
options.multitouch = true
- super({...options, html: html`
+ super({...options, value: [], html: html`
`})
diff --git a/src/client/widgets/sliders/slider.js b/src/client/widgets/sliders/slider.js
index af5622e4..62ebbf57 100644
--- a/src/client/widgets/sliders/slider.js
+++ b/src/client/widgets/sliders/slider.js
@@ -14,7 +14,6 @@ class Slider extends Canvas {
this.container.classList.add('design-' + this.getProp('design'))
- this.value = undefined
this.percent = 0
this.gaugePadding = 0