From 4fc3f453feb7fdeee6b56d247269c0738cf7b374 Mon Sep 17 00:00:00 2001 From: Saul Clavijo Date: Tue, 26 Nov 2019 06:42:01 -0300 Subject: [PATCH] [Autocomplete] Show loading text when there are no options (#18570) --- packages/material-ui-lab/src/Autocomplete/Autocomplete.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/material-ui-lab/src/Autocomplete/Autocomplete.js b/packages/material-ui-lab/src/Autocomplete/Autocomplete.js index f236baa0ec710b..bd6f52c52ff4e2 100644 --- a/packages/material-ui-lab/src/Autocomplete/Autocomplete.js +++ b/packages/material-ui-lab/src/Autocomplete/Autocomplete.js @@ -378,7 +378,9 @@ const Autocomplete = React.forwardRef(function Autocomplete(props, ref) { open > - {loading ?
{loadingText}
: null} + {loading && groupedOptions.length === 0 ? ( +
{loadingText}
+ ) : null} {groupedOptions.length === 0 && !freeSolo && !loading ? (
{noOptionsText}
) : null}