Reputation: 244
When using nouislider I'm attempting a slider with one handle and a connect in the lower region:
noUiSlider.create(slider, {
start: 20,
connect: [true,false],
range: {
min: 0,
max: 100
}
});
The documentation here https://refreshless.com/nouislider/slider-options/ clearly states:
Pass an array with a boolean for every connecting element, including the edges of the slider. The length of this array must match the handle count + 1.
But I end up with an error of:
'connect' option doesn't match handle count.
Having looked over the test that takes place in the javascript, it appears to be expecting strings such as 'lower', 'upper'. Anyone managed to get what I'm trying to achieve to work, or understand what the problem is? I'm using the npm version of nouislider.
Upvotes: 4
Views: 2954
Reputation: 4898
The connect
option slightly changed in the update from noUiSlider 8.x to 9.x. You are using a new syntax with an older version.
Version 8.x throws the error you've encountered. You can either upgrade to noUiSlider 9.1 (which is almost entirely API compatible to 8.x), or use connect: "lower"
(which will also work in noUiSlider 9.x).
Upvotes: 6