Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
tdnl committed Sep 1, 2023
1 parent c0c5830 commit c4de05c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/ra-ui-materialui/src/input/AutocompleteInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -450,11 +450,12 @@ If you provided a React element for the optionText prop, you must also provide t
}
}, [getOptionLabel, multiple, selectedChoice]);

const handleInputChange = (
event: React.SyntheticEvent,
newInputValue: string,
_reason: string
) => {
const handleInputChange: AutocompleteProps<
OptionType,
Multiple,
DisableClearable,
SupportCreate
>['onInputChange'] = (event, newInputValue, reason) => {
if (
event?.type === 'change' ||
!doesQueryMatchSelection(newInputValue)
Expand All @@ -463,7 +464,7 @@ If you provided a React element for the optionText prop, you must also provide t
debouncedSetFilter(newInputValue);
}

onInputChange?.(event);
onInputChange?.(event, newInputValue, reason);
};

const doesQueryMatchSelection = useCallback(
Expand Down

0 comments on commit c4de05c

Please sign in to comment.