diff --git a/apps/portal/src/components/shared/CitiesTypeahead.tsx b/apps/portal/src/components/shared/CitiesTypeahead.tsx index 902759b0..f9a6140d 100644 --- a/apps/portal/src/components/shared/CitiesTypeahead.tsx +++ b/apps/portal/src/components/shared/CitiesTypeahead.tsx @@ -41,6 +41,7 @@ export default function CitiesTypeahead({ return ( - setQuery('')} - as={Fragment} - leave="transition ease-in duration-100" - leaveFrom="opacity-100" - leaveTo="opacity-0"> - - {options.length === 0 && query !== '' ? ( -
- {noResultsMessage} -
- ) : ( - options.map((option) => ( - - clsx( - 'relative cursor-default select-none py-2 px-4 text-slate-500', - active && 'bg-slate-100', - ) - } - value={option}> - {({ selected }) => ( - - {option.label} - - )} - - )) - )} -
-
+ {query.length >= minQueryLength && ( + setQuery('')} + as={Fragment} + leave="transition ease-in duration-100" + leaveFrom="opacity-100" + leaveTo="opacity-0"> + + {options.length === 0 && query !== '' ? ( +
+ {noResultsMessage} +
+ ) : ( + options.map((option) => ( + + clsx( + 'relative cursor-default select-none py-2 px-4 text-slate-500', + active && 'bg-slate-100', + ) + } + value={option}> + {({ selected }) => ( + + {option.label} + + )} + + )) + )} +
+
+ )} {errorMessage && (