I'm using MUI 4.1.2 I set up a Select which is working except that when an item from the Select is chosen, that item does not show the viewable display after clicking it. I have a log setup and it does log the item that was chosen.
<FormControl>
<Select
value={this.state.quoteListName}
onChange={this.handleChange}
variant="outlined"
displayEmpty={true}
input={<Input id="QuoteListPlaceholder" />}
renderValue={
this.state.quoteListName > 0
? undefined
: () => <em>Select a Quote List</em>
}
>
<MenuItem value="" disabled>
<em>Select a Quote List</em>
</MenuItem>
{data.me.quoteList.map(item => {
return (
<MenuItem value={item.name} key={item.name}>
{item.name}
</MenuItem>
);
})}
</Select>
</FormControl>
I found the renderValue code in a stack overflow post. I may have not set that up correctly? It does show the "Select a Quote list" text but that is still showing after an item from the Select is chosen. Note that I did try
this.state.quoteListName.length > 0
but it didn't work.