fix: improve autocomplete typings
This commit is contained in:
parent
9d0936ed54
commit
e0dadaf817
@ -32,7 +32,7 @@ export interface AutocompleteProps<T> {
|
||||
required?: boolean;
|
||||
displayValue: (item: T | T[] | null) => string;
|
||||
onQuery: (query: string) => void;
|
||||
onChange: AutocompleteChangeEventHandler<T | undefined>;
|
||||
onChange: (value: T | T[] | undefined) => void;
|
||||
}
|
||||
|
||||
const Autocomplete = function <T>(
|
||||
|
@ -296,7 +296,7 @@ const RelationControl: FC<WidgetControlProps<string | string[], RelationField>>
|
||||
const ref = useRef<HTMLButtonElement | null>(null);
|
||||
|
||||
const handleChange = useCallback(
|
||||
(newValue: string | string[] | null) => {
|
||||
(newValue: string | string[] | undefined) => {
|
||||
if (!newValue) {
|
||||
setInternalValue(newValue);
|
||||
onChange(newValue);
|
||||
|
Loading…
x
Reference in New Issue
Block a user