Open WhileTrueEndWhile opened 6 years ago
Update:
I can't reproduce it by myself today, sorry! But there are breaking changes at least. Since version 1.5.24 the multiselect returns an object like
{
value: 1 // data
text: "One" // optionLabels[i]
}
instead of simply
1
So alpaca produces a JSON object that is not valid. A schema validation would fail because in this case the type is a primitive and alpaca returns an object.
{
"data": "coffee",
"schema": {
"type": "array",
"items": {
"enum": ["a", "b", "c"]
}
},
"options": {
"type": "select",
"events": {
"change": function() {alert(JSON.stringify(this.getValue(), null, " "))}
}
}
}
Thanks!
Update 2:
This configuration shows my problem in the first case:
{
"data": null,
"schema": {
"type": "integer",
"enum": [
1,
2
]
},
"options": {
"type": "select",
"events": {
"change": function() {alert(this.getValue())}
}
}
}
The value is always null! Seems that alpaca does not accept integer types. Number works.
Yup, just discovered this with the new verison as well.
Thank you for replying to this confusing thread. So, please let me know, If you have some "migration trouble", too. I had to change some templates, but this is not enough.
I would assume that this worked with the old version:
{
"data": false,
"schema": {
"type": "boolean",
"enum": [false, true]
},
"options": {
"optionLabels": ["Not True", "Not False"],
"view": {
"parent": "bootstrap-display-horizontal"
}
}
}
Now it shows the raw data (without escaping as normal) and does NOT display the optionLabels... In my app the optionLabels are some font awesome chars (\uXXXX) which do not appear if the new version is in use. It shows "false" or "true".
I'm not sure if this is the same issue or a related issue but I'm going to post it here. It looks like the change event is being fired twice in v1.5.24 vs once in v1.5.23 (which is the proper behavior). Refer to this fiddle:
https://jsfiddle.net/9yr9dLaz/
Can we get this fixed immediately? This is preventing me from updating to the latest version.
@quakedc I'm getting the same problem. I am going to raise another issue to increase visibility of this to the Alpaca team.
Issues since version 1.5.24 compared to version 1.5.23
Hi,please try the following configuration (on e.g. http://www.alpacajs.org/docs/fields/select.html):Try this with and without the optionLabels.If you add the optionLabels it does not work anymore.The output is then broken, too! The field's value remains undefined.Thank you!