formio.js
formio.js copied to clipboard
[BUG] Select component on select not propagated
I found a bug with the select component when doing infinite scrolling of URL requests. Firstly, when the user scrolls, a new request is made (expect to be made when scrolling to bottom). Secondly, if the request is pending, the selection isn't propagated. Therefore, if there is other components with calculated values that depends on the select one, the values aren't computed.
This only occurs when the selection is made while the pagination request is pending.
Environment
Please provide as many details as you can:
- Hosting type
- [x] Form.io
- Formio Builder
Steps to Reproduce
- Go to Formio Builder
- Build the form like the one given below
- Select and Honda Model
- Open the Select component DropDown again
- Scroll down
- Select other Honda Model
You may need to throttle your request, so that each of the pagination request last enough.
Expected behavior
- The new Honda Model is selected.
- The components "ID" and "Name" will be recalculated
Observed behavior
- The new Honda Model is selected but a couple of seconds later it is reseted to the first selection
- The components aren't recalculated
Example
Vídeo reproducing the bug
For code or form JSON, please enclose in a code block:
{
"display": "form",
"settings": {
"pdf": {
"id": "1ec0f8ee-6685-5d98-a847-26f67b67d6f0",
"src": "https://files.form.io/pdf/5692b91fd1028f01000407e3/file/1ec0f8ee-6685-5d98-a847-26f67b67d6f0"
}
},
"components": [
{
"label": "Honda",
"widget": "choicesjs",
"tableView": true,
"dataSrc": "url",
"data": {
"url": "https://vpic.nhtsa.dot.gov/api/vehicles/getmodelsformake/honda?format=json",
"headers": [
{
"key": "",
"value": ""
}
]
},
"idPath": "Make_ID",
"template": "<span>{{ item.Model_Name }}</span>",
"key": "select",
"type": "select",
"selectValues": "Results",
"disableLimit": false,
"limit": 90,
"ignoreCache": true,
"input": true
},
{
"label": "ID",
"tableView": true,
"calculateValue": "value = data.select.Model_ID",
"key": "textField",
"type": "textfield",
"input": true
},
{
"label": "Name",
"tableView": true,
"calculateValue": "value = data.select.Model_Name",
"key": "textField1",
"type": "textfield",
"input": true
},
{
"type": "button",
"label": "Submit",
"key": "submit",
"disableOnInvalid": true,
"input": true,
"tableView": false
}
],
"input": true,
"key": "",
"tableView": false,
"label": ""
}
happens to me
Closing this thread as it is outdated. Please re-open if it is still relevant. Thank you for your contribution!