Skip to content

Commit

Permalink
Fix warning in AutocompleteInput
Browse files Browse the repository at this point in the history
  • Loading branch information
fzaninotto committed Jan 7, 2019
1 parent 3b4323e commit e5cc8cd
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions packages/ra-ui-materialui/src/input/AutocompleteInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ export class AutocompleteInput extends React.Component {
source,
value,
ref,
options: { InputProps, ...options },
options: { InputProps, suggestionsContainerProps, ...options },
...other
} = inputProps;
if (typeof meta === 'undefined') {
Expand Down Expand Up @@ -441,14 +441,17 @@ export class AutocompleteInput extends React.Component {
this.previousFilterValue = value;
};

shouldRenderSuggestions = (val) => {
const { shouldRenderSuggestions } = this.props;
if (shouldRenderSuggestions !== undefined && typeof shouldRenderSuggestions === 'function') {
return shouldRenderSuggestions(val)
}
shouldRenderSuggestions = val => {
const { shouldRenderSuggestions } = this.props;
if (
shouldRenderSuggestions !== undefined &&
typeof shouldRenderSuggestions === 'function'
) {
return shouldRenderSuggestions(val);
}

return true
}
return true;
};

render() {
const {
Expand Down

0 comments on commit e5cc8cd

Please sign in to comment.