From e5cc8cda068eb2ea163e1317aedaeab54a1625d7 Mon Sep 17 00:00:00 2001 From: fzaninotto Date: Mon, 7 Jan 2019 14:34:49 +0100 Subject: [PATCH] Fix warning in AutocompleteInput --- .../src/input/AutocompleteInput.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/ra-ui-materialui/src/input/AutocompleteInput.js b/packages/ra-ui-materialui/src/input/AutocompleteInput.js index edd9fbb6b03..1976859b20d 100644 --- a/packages/ra-ui-materialui/src/input/AutocompleteInput.js +++ b/packages/ra-ui-materialui/src/input/AutocompleteInput.js @@ -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') { @@ -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 {