From f7dee1068ba845e1a99b526569d72398d2a32c3a Mon Sep 17 00:00:00 2001 From: Josh Reisner <1551689+joshreisner@users.noreply.github.com> Date: Sun, 4 Sep 2022 14:51:51 -0700 Subject: [PATCH] fix case search for #36 --- src/App.tsx | 7 ++++++- src/helpers/filter.ts | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index f565258..2b8602a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -52,7 +52,12 @@ export const App = () => { }, [state]); useEffect(() => { - setSearchWords(state.search.split(' ').filter(e => e)); + setSearchWords( + state.search + .toLowerCase() + .split(' ') + .filter(e => e) + ); }, [state.search]); //set html attributes diff --git a/src/helpers/filter.ts b/src/helpers/filter.ts index 4fcef54..59ffbe5 100644 --- a/src/helpers/filter.ts +++ b/src/helpers/filter.ts @@ -75,7 +75,10 @@ export function filter( //search? if (search) { - const searchWords = search.split(' ').filter(e => e); + const searchWords = search + .toLowerCase() + .split(' ') + .filter(e => e); meetings = meetings.filter( meeting => searchWords.map(word => meeting.search.includes(word)).filter(e => e)