How searchable() works on form enum Select?

My Select is defined like this: Select::make('country') ->label('Country') ->required() ->options(Country::class) ->searchable() Country class is enum, which implements HasLabel. Is it exact match searching or some kind of Levenshtein? When i'm typing, select show records, which in my opinion should not be suggested. When i typed "Polska" i see "Polska" option at first position, but select shows also options like: Bostwana, Kostaryka, Holandia, and many others. Is it searchable() native behavior or i missed someting?
No description
7 Replies
Winter Is Coming
try ->searchable('name') or change the 'name' there with your field that contain Country name. Hope it helps.
RafałMaślakMisterPoland
Thanks, but i have enum Select, so there's no columns, just simple enums array key=>value.
Dennis Koch
Dennis Koch5d ago
Whats the value of these enums?
RafałMaślakMisterPoland
Here u can see example enum class.
toeknee
toeknee5d ago
So search will likely only work against 'PL', 'EN' etc I think
RafałMaślakMisterPoland
Nope, search works with labels, but in strange way - u can see on this screen.
No description
RafałMaślakMisterPoland
The exact match is on 1 place, but few other option are also suggested, but i don't know why 🤷‍♂️

Did you find this page helpful?