Skip to content

Commit

Permalink
fix reselect empty in autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
AnkitaGupta111 committed Dec 16, 2020
1 parent be749b7 commit 6995f0e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/ra-ui-materialui/src/input/AutocompleteInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,13 @@ const AutocompleteInput: FunctionComponent<AutocompleteInputProps> = props => {

const handleChange = useCallback(
(item: any) => {
if (getChoiceValue(item) == null && filterValue) {
setFilterValue('');
}

input.onChange(getChoiceValue(item));
},
[getChoiceValue, input]
[filterValue, getChoiceValue, input]
);

// This function ensures that the suggestion list stay aligned to the
Expand Down

0 comments on commit 6995f0e

Please sign in to comment.