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

[BUG] Choices.js Select Dropdown component outputs wrong results in static search

Open celu opened this issue 10 months ago • 2 comments

Describe the bug When searching in the select dropdowns filtering by a single character the results do not filter well, sometimes other values come up that do not even contain that letter. However this behavior does not occur when searching >= to two characters.

Version/Branch Formiojs v5.0.1, also tried in latest 4.X.X version.

To Reproduce Steps to reproduce the behavior:

  1. Open a form that contains a drop-down “select” type component and consumes JSON data from an external url.
  2. Enable static search in select component with a default Threshold of 0.3 (also tried with 0.0). Then save.
  3. Display a drop-down in formio renderer and type one character in the search box.
  4. Observe the results displayed in the selector.

Expected behavior Results containing that character are displayed and no results are displayed if the search does not match.

Screenshots Fomio error

Additional context The bug also occurs in https://formio.github.io/formio.js/app/examples/select.html "External source" example, when you search "s", some results like Accord, Civic... are displayed.

I've also tried settings choices.js settings with a  "searchFloor": 0, but it keeps happenings with some characters like "s", while others like "m" don't fail.

celu avatar Feb 12 '25 12:02 celu

@celu Thank you for reporting this issue. I am able to reproduce and have logged a ticket for the backlog. We are always willing to review any contributions to resolve this issue from the open source community.

For internal reference: FIO-10927.

VikkiAlenn avatar Nov 20 '25 12:11 VikkiAlenn

We were able to work around this in the application by unchecking the Use exact Search property on the component, or removing the "useExactSearch": true, property from the component json.

daneformio avatar Nov 24 '25 18:11 daneformio