尝试将 Material UI 选择组件与 FormControl 和 InputLabel 一起使用时,选择的标签始终呈现在选择组件上方,我不知道为什么。
我的代码看起来像这样
<FormControl>
<InputLabel htmlFor="hey">A Label</InputLabel>
<Select inputProps={{
id: "hey"
}} value="Hey">
<MenuItem value="Hey">
Hey
</MenuItem>
</Select>
</FormControl>
Run Code Online (Sandbox Code Playgroud)