|
|
|
@ -28,6 +28,8 @@ type Props = Readonly<{
|
|
|
|
|
errorMessage?: React.ReactNode;
|
|
|
|
|
isLabelHidden?: boolean;
|
|
|
|
|
label: string;
|
|
|
|
|
// Minimum query length before any results will be shown.
|
|
|
|
|
minQueryLength?: number;
|
|
|
|
|
noResultsMessage?: string;
|
|
|
|
|
onQueryChange: (
|
|
|
|
|
value: string,
|
|
|
|
@ -80,6 +82,7 @@ export default function Typeahead({
|
|
|
|
|
errorMessage,
|
|
|
|
|
isLabelHidden,
|
|
|
|
|
label,
|
|
|
|
|
minQueryLength = 0,
|
|
|
|
|
noResultsMessage = 'No results',
|
|
|
|
|
nullable = false,
|
|
|
|
|
options,
|
|
|
|
@ -167,6 +170,7 @@ export default function Typeahead({
|
|
|
|
|
/>
|
|
|
|
|
</Combobox.Button>
|
|
|
|
|
</div>
|
|
|
|
|
{query.length >= minQueryLength && (
|
|
|
|
|
<Transition
|
|
|
|
|
afterLeave={() => setQuery('')}
|
|
|
|
|
as={Fragment}
|
|
|
|
@ -207,6 +211,7 @@ export default function Typeahead({
|
|
|
|
|
)}
|
|
|
|
|
</Combobox.Options>
|
|
|
|
|
</Transition>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</Combobox>
|
|
|
|
|
{errorMessage && (
|
|
|
|
|