From d7fa35e066cf371797aaa46ca464aa531ba8fb35 Mon Sep 17 00:00:00 2001 From: Salman Tariq Date: Thu, 1 Jun 2023 02:53:50 +0500 Subject: [PATCH] fix(genreselector): fix searching in Genre filter (#3468) --- src/components/Selector/index.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/Selector/index.tsx b/src/components/Selector/index.tsx index 8a21d3fbe..78ae33ea1 100644 --- a/src/components/Selector/index.tsx +++ b/src/components/Selector/index.tsx @@ -169,15 +169,19 @@ export const GenreSelector = ({ loadDefaultGenre(); }, [defaultValue, type]); - const loadGenreOptions = async () => { + const loadGenreOptions = async (inputValue: string) => { const results = await axios.get( `/api/v1/discover/genreslider/${type}` ); - return results.data.map((result) => ({ - label: result.name, - value: result.id, - })); + return results.data + .map((result) => ({ + label: result.name, + value: result.id, + })) + .filter(({ label }) => + label.toLowerCase().includes(inputValue.toLowerCase()) + ); }; return (