From d4dd17d094404f2e7bfd7f70bf2eedc2968b793c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Alby?= Date: Thu, 26 May 2022 14:58:29 +0200 Subject: [PATCH] Merge pull request #8166 from overleaf/msm-settings-fix-uni-autocomplete [Settings] Fix university autocomplete GitOrigin-RevId: ea6b539a25c9363e420a4f04a9522c34d860d4f2 --- .../components/emails/add-email/institution-fields.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/web/frontend/js/features/settings/components/emails/add-email/institution-fields.tsx b/services/web/frontend/js/features/settings/components/emails/add-email/institution-fields.tsx index 79074d851d..d0f9308e08 100644 --- a/services/web/frontend/js/features/settings/components/emails/add-email/institution-fields.tsx +++ b/services/web/frontend/js/features/settings/components/emails/add-email/institution-fields.tsx @@ -107,7 +107,13 @@ function InstitutionFields({ return [] } - return universities[countryCode]?.map(({ name }) => name) ?? [] + return ( + universities[countryCode] + ?.map(({ name }) => name) + .filter(name => + name.trim().toLowerCase().includes(universityName.toLowerCase()) + ) ?? [] + ) } const handleShowInstitutionFields = () => {