mirror of
https://github.com/badlogic/heissepreise.git
synced 2024-06-24 09:25:53 +02:00
Fuzzy search for , and .
This commit is contained in:
parent
ce70ef02a3
commit
d872ec0c52
|
@ -127,7 +127,7 @@ let componentId = 0;
|
|||
function searchItems(items, query, exact) {
|
||||
if (query.length < 3) return [];
|
||||
|
||||
const tokens = query.split(/\s+/).map(token => token.toLowerCase());
|
||||
const tokens = query.split(/\s+/).map(token => token.toLowerCase().replace(",", "."));
|
||||
|
||||
const hits = [];
|
||||
for (item of items) {
|
||||
|
@ -159,7 +159,7 @@ function searchItems(items, query, exact) {
|
|||
function newSearchComponent(parentElement, items, filter, headerModifier, itemDomModifier) {
|
||||
for (item of items) {
|
||||
item.search = item.name + " " + item.unit;
|
||||
item.search = item.search.toLowerCase();
|
||||
item.search = item.search.toLowerCase().replace(",", ".");;
|
||||
}
|
||||
|
||||
let id = componentId++;
|
||||
|
|
Loading…
Reference in New Issue
Block a user