Skip to content

Commit

Permalink
[RFR] Fix AutocompleteInput reopen after selection
Browse files Browse the repository at this point in the history
Fixes #2428
  • Loading branch information
djhi committed Jan 30, 2019
1 parent a466471 commit 26456f8
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions packages/ra-ui-materialui/src/input/AutocompleteInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,9 @@ export class AutocompleteInput extends React.Component {
const { input } = this.props;

const inputValue = this.getSuggestionValue(suggestion);
this.setState(
{
dirty: false,
inputValue,
selectedItem: suggestion,
searchText: this.getSuggestionText(suggestion),
suggestions: [suggestion],
},
() => input && input.onChange && input.onChange(inputValue)
);
if (input && input.onChange) {
input.onChange(inputValue)
}

if (method === 'enter') {
event.preventDefault();
Expand Down

0 comments on commit 26456f8

Please sign in to comment.