diff --git a/src/IconList.jsx b/src/IconList.jsx index 10acedb..d4c4ea4 100644 --- a/src/IconList.jsx +++ b/src/IconList.jsx @@ -16,14 +16,19 @@ export const IconList = function () { const keywords = query.toLowerCase().split(' ').filter(word => (word)) let filtered = []; for (const filename in iconData) { - const matched = iconData[filename].filter(tag => { - for (const keyword of keywords) { + const matched = keywords.filter(keyword => { + for (const tag of iconData[filename]) { if (tag.indexOf(keyword.toLowerCase()) != -1) return true } - return false }) + // const matched = iconData[filename].filter(tag => { + // for (const keyword of keywords) { + // if (tag.indexOf(keyword.toLowerCase()) != -1) return true + // } + // return false + // }) - if (matched.length) filtered.push(filename) + if (matched.length == keywords.length) filtered.push(filename) } console.log(filtered)