mirror of
https://github.com/Choices-js/Choices.git
synced 2026-03-14 22:55:46 +01:00
Fix KMP search-as-you-type not returning results as expected
This commit is contained in:
parent
073d7a8b9a
commit
ffda4cbdfd
1 changed files with 2 additions and 1 deletions
|
|
@ -73,11 +73,12 @@ export class SearchByKMP<T extends object> implements Searcher<T> {
|
|||
const field = this._fields[k];
|
||||
if (field in obj && kmpSearch(needle, (obj[field] as string).toLowerCase()) !== -1) {
|
||||
results.push({
|
||||
item: obj[field],
|
||||
item: obj,
|
||||
score: count,
|
||||
rank: count + 1,
|
||||
});
|
||||
count++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue