Edit Choices.js configuration
Hi, when I create a
Select
component with HTML options, the search function does not work well. This is because the search is performed on the label, instead of the value.
When I set the Choices.js configuration option searchableOptionFields
to value
instead of label
(in Chrome dev tools), searching works fine.
Is there a way to change this?



Solution:Jump to solution
this an old artical but you can adjust it to make work with v3
https://v2.filamentphp.com/tricks/render-html-in-select-options
combine
getSearchResultsUsing
and getOptionLabelUsing
...4 Replies
Or... just adjust the search with:
https://filamentphp.com/docs/3.x/forms/fields/select#returning-custom-search-results
Thanks @toeknee, I tried that. But then my search results don't contain HTML (or I am doing something wrong)
Solution
this an old artical but you can adjust it to make work with v3
https://v2.filamentphp.com/tricks/render-html-in-select-options
combine
getSearchResultsUsing
and getOptionLabelUsing
Thanks, that works!