F
Filament6d ago
Veur

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?
No description
No description
No description
No description
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...
Jump to solution
4 Replies
Veur
VeurOP6d ago
Thanks @toeknee, I tried that. But then my search results don't contain HTML (or I am doing something wrong)
Solution
Lara Zeus
Lara Zeus6d ago
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
Veur
VeurOP3d ago
Thanks, that works!

Did you find this page helpful?