From 949fb4732612b244cc15160d171d04cd914137e7 Mon Sep 17 00:00:00 2001 From: osorionicolas Date: Fri, 22 Sep 2023 10:41:32 +0200 Subject: [PATCH] Set search as case-insensitive for authentication steps (#23406) Closes #21989 --- .../components/modals/AddStepModal.tsx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/js/apps/admin-ui/src/authentication/components/modals/AddStepModal.tsx b/js/apps/admin-ui/src/authentication/components/modals/AddStepModal.tsx index 9c29bbce1d..27203aef58 100644 --- a/js/apps/admin-ui/src/authentication/components/modals/AddStepModal.tsx +++ b/js/apps/admin-ui/src/authentication/components/modals/AddStepModal.tsx @@ -90,16 +90,16 @@ export const AddStepModal = ({ name, type, onSelect }: AddStepModalProps) => { [], ); - const page = useMemo( - () => - localeSort(providers ?? [], mapByKey("displayName")) - .filter( - (p) => - p.displayName?.includes(search) || p.description?.includes(search), - ) - .slice(first, first + max + 1), - [providers, search, first, max], - ); + const page = useMemo(() => { + const normalizedSearch = search.trim().toLowerCase(); + return localeSort(providers ?? [], mapByKey("displayName")) + .filter( + ({ displayName, description }) => + displayName?.toLowerCase().includes(normalizedSearch) || + description?.toLowerCase().includes(normalizedSearch), + ) + .slice(first, first + max + 1); + }, [providers, search, first, max]); return (