[BUG] Multiselect of select component failed to search second and rest of the entry
Environment
Please provide as many details as you can:
- Hosting type
- [] Form.io
- [x] Local deployment
- Version:
- Formio.js version: 4.9.9
- Frontend framework:angular-formio
- Browser:Chrome
- Browser version:
Steps to Reproduce
- Please choose the select component. and convert that to multi-select.
- In data section choose URL as a data source type. and enter any API URL (https://jsonplaceholder.typicode.com/todos)
- Enter Search Query Name as q
- Change Item Template to data.title
- Search for any record and select.
- Search for another record.
Expected behaviour
It should search and select for multiple entries.
Observed behaviour
It perfectly works for first selection. And if you try for a second and rest of it breaks. Also checked in the console that API calls perfectly with a search query and returning appropriate data but not updating the list.
Example
Providing the JSON schema of the components to validate.
{
"display": "form",
"components": [
{
"label": "Select",
"widget": "choicesjs",
"tableView": true,
"multiple": true,
"dataSrc": "url",
"defaultValue": [
{}
],
"data": {
"values": [
{
"label": "",
"value": ""
}
],
"url": "https://jsonplaceholder.typicode.com/todos",
"headers": [
{
"key": "",
"value": ""
}
]
},
"dataType": "object",
"template": "<span>{{ item.title }}</span>",
"selectThreshold": 1,
"calculateServer": false,
"validate": {
"select": false,
"multiple": true
},
"key": "select",
"type": "select",
"indexeddb": {
"filter": {}
},
"searchField": "q",
"input": true,
"disableLimit": true,
"lazyLoad": false
},
{
"type": "button",
"label": "Submit",
"key": "submit",
"disableOnInvalid": true,
"input": true,
"tableView": false
}
]
}
@Inaamhusain It seems that 'data.title' in the item template is not returning any values for the multi select example detailed above.
We have fixed several issues with the Select component recently. Can you try upgrading to version 4.9.13 to see if this issue is resolved?
@jhen1422 It seems it is not resolved in the latest version also. still facing the same issue.
@jhen1422 Did you get a chance to looked into it?
@Inaamhusain I did some investigating but was unable to replicate. I ended up using my own URL because the example you provided was not returning results. Do you mind providing a jsfiddle the shows the issue?
@jhen1422 Please find the attached link of jsfiddle. https://jsfiddle.net/486jp7t1/ May be something changed in the latest version which sometimes works and sometimes not. there were some other issues also observed. so when you scroll for second value list is getting a repeat.
@jhen1422 can you replicate the issue?
@Inaamhusain we were not able to replicate this issue using the jsfiddle that you provided as it is still not returning results. Please find the attached link of jsfiddle of this working as expected: https://jsfiddle.net/bt06zdhs/
@wag110894 Basically it breaking when you provide "searchField": "q". I mean there an option in component for a search field. Where it will be hitting API with the specified search text list based on the input text. Let me know if you need more clarification.
@wag110894 Did you get a chance to look into this?
@Inaamhusain,
We are still not able to replicate this issue. We do offer Support Packages that are for training, support or development services. The hours can be used in one-hour increments at your convenience over a 90 day period. We will assign one of our senior developers to work directly with you in online sessions. Please contact [email protected] for more information regarding our Support Packages.
@wag110894 and @jhen1422
I am also facing the same issue reported by @Inaamhusain this is causing in multi-select for it perfectly works for the first selection and if you try for a second and rest of it breaks showing duplicate records when you scroll down. you check this on Fiddle
Closing this thread as it is outdated. Please re-open if it is still relevant. Thank you for your contribution!