mirror of
https://github.com/TheThomaas/my-online-cookbook.git
synced 2026-01-10 03:51:38 +00:00
Fix casing issue in search
This commit is contained in:
parent
1a97b78cee
commit
46f9092189
|
|
@ -16,9 +16,9 @@
|
|||
if (searchInput.length < 3) { return };
|
||||
|
||||
searchResults.forEach(recipe => {
|
||||
const matchTitle = recipe.title.toLowerCase().includes(searchInput);
|
||||
const matchIngredient = recipe.ingredients.find(ingredient => ingredient.toLowerCase().includes(searchInput));
|
||||
const matchTag = recipe.tags.find(tag => tag.toLowerCase().includes(searchInput));
|
||||
const matchTitle = recipe.title.toLowerCase().includes(searchInput.toLowerCase());
|
||||
const matchIngredient = recipe.ingredients.find(ingredient => ingredient.toLowerCase().includes(searchInput.toLowerCase()));
|
||||
const matchTag = recipe.tags.find(tag => tag.toLowerCase().includes(searchInput.toLowerCase()));
|
||||
|
||||
if (!matchTitle && !matchIngredient && !matchTag) { return };
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue