Closed noskill24 closed 1 year ago
Yes, that is by design. If there are more matches, allow user to type more or they should select an option.
If user just types"Andorra", why it is not equal to select "Andora"? I think it is poor design. User selected this value by typing. Ok, how can I detect Exact Match in this case?
If user just types"Andorra", why it is not equal to select "Andora"? I think it is poor design. User selected this value by typing. Ok, how can I detect Exact Match in this case?
I think you should be able to figure out why ...
The user can just press enter to select it. Else you would not be able to type "Andorra 12", it would jump directory to "Andorra".
You could (ab)use onSearchComplete for this :
onSearchComplete: function (query, suggestion) {
if(query == suggestion[0].value)
{
console.log("we should select this one");
}
},
Most certainly there are more elegant solutions possible.
That is by design.
onSelect-event doesn't firing if array of suggestions contains similar values:
If I type "Andorra 123" (using keyboard, not select) - onSelect event will fire because there is ONE exact match! If I type for example "Andorra" - onSelect event will not fire because there are FOUR matches!
But there is STILL ONE exact match - "Andorra" from four total matches (three other are not exact)!
This bug happens because isExactMatch-function checks exact match when one and only one match is found.