【发布时间】:2019-08-28 13:57:19
【问题描述】:
我很难选择这个选项。看起来displayEmpty 道具可能存在错误。我尝试了以下方法,但是当value === ""
<FormControl>
<InputLabel htmlFor="profile-select">Profile</InputLabel>
<Select
value={values.accessProfile}
onChange={handleChange("accessProfile")}
input={<Input id="profile-select" />}
displayEmpty
>
<MenuItem value={""}>None</MenuItem>
{profiles.map(profile => (
<MenuItem value={profile.id}>{profile.name}</MenuItem>
))}
</Select>
</FormControl>
【问题讨论】:
-
你能提供一个codepen吗?
标签: reactjs material-ui