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

[BUG] Search in select component options malfunctioning

Open imshivamchauhan opened this issue 7 years ago • 4 comments

Environment

Please provide as many details as you can:

  • Hosting type
    • [x] Form.io
    • [ ] Local deployment
      • Version: latest
  • Formio.js version: latest
  • Frontend framework: angular-formio
  • Browser: any
  • Browser version: any

Steps to Reproduce

  1. Drag drop select component, add some options under data tab.
  2. Now in preview, try to search "span" keyword, it will show all options.
  3. Span keyword in added automatically in all options (may be because of default template i.e., {{item.label}})

Expected behavior

"span" keyword should be handled and search should work for typed keyword.

Observed behavior

type "span" keyword, it will still show all options.

image

@travist @randallknutson @jhen1422

imshivamchauhan avatar Dec 03 '19 10:12 imshivamchauhan

This is probably an issue with the choices.js library we use as the select widget. I know that it does have a search "threshold" value that can be provided that can tweak the search capabilities, so curious if that can be used to get the results that you are after.

travist avatar Dec 03 '19 14:12 travist

i independently checked in choice.js library, its working fine there & also not an issue with threshold also. may be formio is sending whole template as label, i looked into your code, as far as i understood, template looks like this <span>{{ item.label }}</span> In formio code, you are replacing "<" & ">" and may be setting span{{item.label}}/span as Label, thats why may be this issue is coming. @travist

imshivamchauhan avatar Dec 04 '19 05:12 imshivamchauhan

@imshivamchauhan Thank you for the report. We identified the issue and have created a ticket in our 4x backlog. We will review during our planning meeting next week. Please note, we welcome pull requests in this library. If you need this item expedited, please feel free to contact [email protected] for pricing.

jeriah-formio avatar Dec 04 '19 14:12 jeriah-formio

We're currently addressing a backlog of GitHub issues. Closing this thread as it is outdated. Please re-open if it is still relevant. Thank you for your contribution!

olgabann avatar Jan 24 '24 14:01 olgabann