Fix casing issue in search
This commit is contained in:
parent
1a97b78cee
commit
46f9092189
|
|
@ -16,9 +16,9 @@
|
||||||
if (searchInput.length < 3) { return };
|
if (searchInput.length < 3) { return };
|
||||||
|
|
||||||
searchResults.forEach(recipe => {
|
searchResults.forEach(recipe => {
|
||||||
const matchTitle = recipe.title.toLowerCase().includes(searchInput);
|
const matchTitle = recipe.title.toLowerCase().includes(searchInput.toLowerCase());
|
||||||
const matchIngredient = recipe.ingredients.find(ingredient => ingredient.toLowerCase().includes(searchInput));
|
const matchIngredient = recipe.ingredients.find(ingredient => ingredient.toLowerCase().includes(searchInput.toLowerCase()));
|
||||||
const matchTag = recipe.tags.find(tag => tag.toLowerCase().includes(searchInput));
|
const matchTag = recipe.tags.find(tag => tag.toLowerCase().includes(searchInput.toLowerCase()));
|
||||||
|
|
||||||
if (!matchTitle && !matchIngredient && !matchTag) { return };
|
if (!matchTitle && !matchIngredient && !matchTag) { return };
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue