Closed guifsdev closed 1 year ago
i had the issue recently with ids as well (being numbers instead of strings) this should fix it https://github.com/lekoala/bootstrap5-autocomplete/releases/tag/1.1.10
ah sorry read that too quickly
yes indeed the value itself is not found because it looks at the data. i will find a way to also look for the value
i added a data-search-fields that accepts an array https://github.com/lekoala/bootstrap5-autocomplete/releases/tag/1.1.11
My sincere thanks for your invaluable contribution. Your update has greatly improved my application, and I am truly grateful for your assistance. Keep up the good work.
:-) you are welcome, i also think it's a fine addition closing the issue
First of all, thank you for this amazing component, that I been using for a time now. I have
PhoneNumber
resources coming from an api endpoint. I implemented a search functionality for these resources usingAutocomplete
as a component like this:I have the following PhoneNumber object as an example in which
full_phone_number
andphone_and_name
are added attributes, that I generate after querying database and before responding from server.So, in Autocomplete if I have the query like: '8495', I get a no results message regardless of a single result response in the inspector that indeed matches the
field
(phone_number
) that was used in the component.I presume that, because
data-label-field
is set tophone_and_name
, my query is checked against this key and not the intended one (field
). The expected behavior was that the suggestion was shown no matter the value of the label associated with the result. The result should depend on field.