css - 'outlined' not working in Material UI Select
问题描述
I am implementing Material UI `Select' for which values are coming from backend. Below is my code
<FormControl variant="outlined" className={classes.formControl}>
<InputLabel ref={inputLabel} id="demo-simple-select-outlined-label" htmlFor="outlined-Name">
Name
</InputLabel>
<Select
value={Name}
onChange={handleChange}
labelWidth={labelWidth}
inputProps={{
name: 'Name',
id: 'outlined-Name',
}}
>
<MenuItem value="1" className={classes.menuItm}>All</MenuItem>
{
NameArr.data.map(Name => (
<MenuItem value={Name.name} className={classes.menuItm}>{Name.name}</MenuItem>
))
}
</Select>
</FormControl>
The problem with below code is that variant="outlined"
is not getting applied. I am not able to see the outline/border which should be there as per the demo here https://codesandbox.io/s/material-demo-9jyoj
What's wrong in my code?
解决方案
您需要更新@material-ui/core
软件包。在当前版本中 ( 4.9.1
)outlined
被正确地传递给<FormControl>
孩子。
对我个人而言,从更新4.1.0
到4.9.1
解决了这个问题。
推荐阅读
- javascript - 为什么子弹会走错路?
- python - 根据 Kivy 中的返回值设置默认屏幕
- php - 用于签署推送通知令牌的 Apple 签名密钥的 x、y 和曲线参数是什么?
- java - 在 RecyclerView 中显示 SQLite DB 数组列表不断崩溃
- typescript - 使用 TypeScript 的捆绑器
- ios - 通过蜂窝连接连接时出现 SSL 错误
- python - 如何在 python 中读取文件并将其内容保存到二维数组?
- c++ - 条件运算符从其参数的副本返回值
- sql-server - 如何使用 SSIS 每周导入文件?
- c++ - 是否可以将引号 („) 放入 Char