From e0dadaf8179e1052a472244f5c2d23296b7c5fd6 Mon Sep 17 00:00:00 2001 From: Daniel Lautzenheiser Date: Thu, 31 Aug 2023 11:53:53 -0400 Subject: [PATCH] fix: improve autocomplete typings --- .../common/autocomplete/Autocomplete.tsx | 14 +++++++------- .../core/src/widgets/relation/RelationControl.tsx | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/core/src/components/common/autocomplete/Autocomplete.tsx b/packages/core/src/components/common/autocomplete/Autocomplete.tsx index e77d0440..2f963211 100644 --- a/packages/core/src/components/common/autocomplete/Autocomplete.tsx +++ b/packages/core/src/components/common/autocomplete/Autocomplete.tsx @@ -32,7 +32,7 @@ export interface AutocompleteProps { required?: boolean; displayValue: (item: T | T[] | null) => string; onQuery: (query: string) => void; - onChange: AutocompleteChangeEventHandler; + onChange: (value: T | T[] | undefined) => void; } const Autocomplete = function ( @@ -135,9 +135,9 @@ const Autocomplete = function ( `, disabled && ` - text-gray-300/75 - dark:text-gray-600/75 - `, + text-gray-300/75 + dark:text-gray-600/75 + `, )} aria-hidden="true" /> @@ -153,9 +153,9 @@ const Autocomplete = function ( `, disabled && ` - text-gray-300/75 - dark:text-gray-600/75 - `, + text-gray-300/75 + dark:text-gray-600/75 + `, )} aria-hidden="true" /> diff --git a/packages/core/src/widgets/relation/RelationControl.tsx b/packages/core/src/widgets/relation/RelationControl.tsx index e85c36f3..e627882e 100644 --- a/packages/core/src/widgets/relation/RelationControl.tsx +++ b/packages/core/src/widgets/relation/RelationControl.tsx @@ -296,7 +296,7 @@ const RelationControl: FC> const ref = useRef(null); const handleChange = useCallback( - (newValue: string | string[] | null) => { + (newValue: string | string[] | undefined) => { if (!newValue) { setInternalValue(newValue); onChange(newValue);