I’ve checked and it looks like this is a limitation of the default parseValue function, items which have space will only identify if there is a value property specified in the data.
One possible solution to update the parsValue function to your needs. Example:
mobiscroll.scroller("#idOfElement", {
wheels: [
{
data: ["Albert Einstein","Marie Curie","Otto Hahn"]
}
],
parseValue: function (val) {
const ret = [];
if (val !== null && val !== undefined) {
ret.push(val)
}
return ret; // Default value if input is empty
}
});
Or another possible solution would be to pass your input data as an object and specify the value property which can be used later with the setVal method. Example:
Thank you Szili for your answer.
I checke all of them and they did work.
The one with data/value I tried before. But I do not like that there are different strings shown for the wheel and input field.
Thats why I opted for changing the parseValue. Now the correct data is selected and both strings for the wheel and input field are the same.