diff --git a/apps/portal/src/components/shared/CompaniesTypeahead.tsx b/apps/portal/src/components/shared/CompaniesTypeahead.tsx index cd54f4e5..619d9a55 100644 --- a/apps/portal/src/components/shared/CompaniesTypeahead.tsx +++ b/apps/portal/src/components/shared/CompaniesTypeahead.tsx @@ -11,6 +11,7 @@ type Props = Readonly<{ onSelect: (option: TypeaheadOption | null) => void; placeholder?: string; required?: boolean; + value?: TypeaheadOption | null; }>; export default function CompaniesTypeahead({ @@ -19,6 +20,7 @@ export default function CompaniesTypeahead({ isLabelHidden, placeholder, required, + value, }: Props) { const [query, setQuery] = useState(''); const companies = trpc.useQuery([ @@ -47,6 +49,7 @@ export default function CompaniesTypeahead({ placeholder={placeholder} required={required} textSize="inherit" + value={value} onQueryChange={setQuery} onSelect={onSelect} /> diff --git a/apps/portal/src/components/shared/JobTitlesTypahead.tsx b/apps/portal/src/components/shared/JobTitlesTypahead.tsx index d266deb4..b5221262 100644 --- a/apps/portal/src/components/shared/JobTitlesTypahead.tsx +++ b/apps/portal/src/components/shared/JobTitlesTypahead.tsx @@ -10,6 +10,7 @@ type Props = Readonly<{ onSelect: (option: TypeaheadOption | null) => void; placeholder?: string; required?: boolean; + value?: TypeaheadOption | null; }>; export default function JobTitlesTypeahead({ @@ -18,6 +19,7 @@ export default function JobTitlesTypeahead({ isLabelHidden, placeholder, required, + value, }: Props) { const [query, setQuery] = useState(''); const options = Object.entries(JobTitleLabels) @@ -42,6 +44,7 @@ export default function JobTitlesTypeahead({ placeholder={placeholder} required={required} textSize="inherit" + value={value} onQueryChange={setQuery} onSelect={onSelect} /> diff --git a/packages/ui/src/Typeahead/Typeahead.tsx b/packages/ui/src/Typeahead/Typeahead.tsx index bf16f07c..bce6fb32 100644 --- a/packages/ui/src/Typeahead/Typeahead.tsx +++ b/packages/ui/src/Typeahead/Typeahead.tsx @@ -37,7 +37,7 @@ type Props = Readonly<{ onSelect: (option: TypeaheadOption | null) => void; options: ReadonlyArray; textSize?: TypeaheadTextSize; - value?: TypeaheadOption; + value?: TypeaheadOption | null; }> & Readonly; @@ -90,6 +90,8 @@ export default function Typeahead({ return (
{ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - onSelect(newValue as TypeaheadOption); + onSelect(newValue as TypeaheadOption | null); }}>