diff --git a/apps/portal/src/components/questions/typeahead/CompanyTypeahead.tsx b/apps/portal/src/components/questions/typeahead/CompanyTypeahead.tsx index c61d1e6c..e3cbaa98 100644 --- a/apps/portal/src/components/questions/typeahead/CompanyTypeahead.tsx +++ b/apps/portal/src/components/questions/typeahead/CompanyTypeahead.tsx @@ -13,7 +13,7 @@ export type CompanyTypeaheadProps = Omit< export default function CompanyTypeahead(props: CompanyTypeaheadProps) { const [query, setQuery] = useState(''); - const { data: companies } = trpc.useQuery([ + const { data: companies, isLoading } = trpc.useQuery([ 'companies.list', { name: query, @@ -33,6 +33,7 @@ export default function CompanyTypeahead(props: CompanyTypeaheadProps) { return ( { diff --git a/apps/portal/src/components/questions/typeahead/RoleTypeahead.tsx b/apps/portal/src/components/questions/typeahead/RoleTypeahead.tsx index fc7ec0ff..f22538c8 100644 --- a/apps/portal/src/components/questions/typeahead/RoleTypeahead.tsx +++ b/apps/portal/src/components/questions/typeahead/RoleTypeahead.tsx @@ -26,7 +26,9 @@ export default function RoleTypeahead(props: RoleTypeaheadProps) { {...(props as ExpandedTypeaheadProps)} label="Role" options={ROLES.filter((option) => - option.label.toLowerCase().includes(query.toLowerCase()), + option.label + .toLocaleLowerCase() + .includes(query.trim().toLocaleLowerCase()), )} onQueryChange={setQuery} /> diff --git a/apps/portal/src/components/shared/CitiesTypeahead.tsx b/apps/portal/src/components/shared/CitiesTypeahead.tsx index f9a6140d..f24a4035 100644 --- a/apps/portal/src/components/shared/CitiesTypeahead.tsx +++ b/apps/portal/src/components/shared/CitiesTypeahead.tsx @@ -36,10 +36,11 @@ export default function CitiesTypeahead({ }, ]); - const { data } = cities; + const { data, isLoading } = cities; return ( b.ranking - a.ranking) - .filter( - ({ label }) => - label.toLocaleLowerCase().indexOf(query.toLocaleLowerCase()) > -1, + .filter(({ label }) => + label.toLocaleLowerCase().includes(query.trim().toLocaleLowerCase()), ); return (