Skip to content

Commit

Permalink
[Autocomplete] Show loading text when there are no options (#18570)
Browse files Browse the repository at this point in the history
  • Loading branch information
sclavijo93 authored and oliviertassinari committed Nov 26, 2019
1 parent 38ffc10 commit 4fc3f45
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/material-ui-lab/src/Autocomplete/Autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,9 @@ const Autocomplete = React.forwardRef(function Autocomplete(props, ref) {
open
>
<PaperComponent className={classes.paper}>
{loading ? <div className={classes.loading}>{loadingText}</div> : null}
{loading && groupedOptions.length === 0 ? (
<div className={classes.loading}>{loadingText}</div>
) : null}
{groupedOptions.length === 0 && !freeSolo && !loading ? (
<div className={classes.noOptions}>{noOptionsText}</div>
) : null}
Expand Down

0 comments on commit 4fc3f45

Please sign in to comment.