Skip to content

Commit

Permalink
fix a type error
Browse files Browse the repository at this point in the history
  • Loading branch information
Khavin Shankar authored and Khavin Shankar committed May 20, 2024
1 parent ca1cc39 commit c31e63e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Components/Form/FormFields/Autocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,17 @@ export const Autocomplete = <T, V>(props: AutocompleteProps<T, V>) => {
>
<Combobox
disabled={props.disabled}
value={value ?? props.placeholder ?? "Select"}
value={value}
onChange={(selection: any) => props.onChange(selection.value)}
>
<div className="relative">
<div className="flex">
<Combobox.Input
className="cui-input-base truncate pr-16"
placeholder={props.placeholder ?? "Select"}
displayValue={(value: any) => value?.label || ""}
displayValue={(value: any) =>
(value?.label || props.placeholder) ?? "Select"
}
onChange={(event) => setQuery(event.target.value.toLowerCase())}
onBlur={() => value && setQuery("")}
autoComplete="off"
Expand Down

0 comments on commit c31e63e

Please sign in to comment.