formio.js icon indicating copy to clipboard operation
formio.js copied to clipboard

[BUG] Multiselect of select component failed to search second and rest of the entry

Open Inaamhusain opened this issue 6 years ago • 12 comments

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

  1. Please choose the select component. and convert that to multi-select.
  2. In data section choose URL as a data source type. and enter any API URL (https://jsonplaceholder.typicode.com/todos)
  3. Enter Search Query Name as q
  4. Change Item Template to data.title
  5. Search for any record and select.
  6. 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 avatar Apr 03 '20 08:04 Inaamhusain

@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?

jeriah-formio avatar Apr 06 '20 14:04 jeriah-formio

@jhen1422 It seems it is not resolved in the latest version also. still facing the same issue.

Inaamhusain avatar Apr 06 '20 16:04 Inaamhusain

@jhen1422 Did you get a chance to looked into it?

Inaamhusain avatar Apr 09 '20 06:04 Inaamhusain

@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?

jeriah-formio avatar Apr 09 '20 14:04 jeriah-formio

@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.

Inaamhusain avatar Apr 13 '20 10:04 Inaamhusain

@jhen1422 can you replicate the issue?

Inaamhusain avatar Apr 15 '20 10:04 Inaamhusain

@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 avatar Apr 15 '20 19:04 wag110894

@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.

Inaamhusain avatar Apr 15 '20 20:04 Inaamhusain

@wag110894 Did you get a chance to look into this?

Inaamhusain avatar Apr 22 '20 06:04 Inaamhusain

@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 avatar Apr 22 '20 14:04 wag110894

@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

shai93 avatar Apr 23 '20 11:04 shai93

Closing this thread as it is outdated. Please re-open if it is still relevant. Thank you for your contribution!

Tatsiana8 avatar Jan 31 '24 14:01 Tatsiana8