Given three sliders one with min/max/step, one with a numeric values array and one with string values array. The data object in the slide callbacks is:
min/max/step:
from: 5 // FROM value, as expected
from_pretty: "5" // FROM value prettified
from_value: null // null, as expected as the values array is not used
numeric values:
from: 2 // FROM value, instead this is the index
from_pretty: "2" // The index prettyfied?
from_value: 3.141592 // FROM index in values array (if used). Instead, this is the value, not the index
string values:
from: 1 // FROM value, instead this is the index
from_pretty: "1" // The index prettyfied?
from_value: "banana" // FROM index in values array (if used). Instead, this is the value, not the index
This can be solved by swapping from and from_value for when the values array is used. The from_value is also confusingly named, I would expect from_index instead. For the three sliders, look here: https://jsfiddle.net/Lhgj1efn/1/
Given three sliders one with min/max/step, one with a numeric values array and one with string values array. The data object in the slide callbacks is:
min/max/step:
numeric values:
string values:
This can be solved by swapping
from
andfrom_value
for when the values array is used. Thefrom_value
is also confusingly named, I would expectfrom_index
instead. For the three sliders, look here: https://jsfiddle.net/Lhgj1efn/1/