Fix casing issue in search

This commit is contained in:
maeligg 2021-12-13 17:07:59 +01:00
parent 1a97b78cee
commit 46f9092189

View file

@ -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 };