如何从反应中的输入字段中删除绿色?

问题描述 投票:-1回答:1

你能告诉我如何从输入字段中删除绿色反应吗?我知道它来自主题,我只是想从这个形式inputselect字段中删除。

Codesandbox

enter image description here

const theme = createMuiTheme({
  palette: {
    primary: green,
    secondary: green
  },
  overrides: {
    MuiInput: {
      underline: {
        color: "red",
        "&:hover:not($disabled):after": {},
        "&:hover:not($disabled):before": {}
      }
    }
  }
});
reactjs react-redux material-design material-ui
1个回答
0
投票

我已经分叉了你的代码示例,并在主题覆盖中进行了编辑,以更改表单标签https://codesandbox.io/s/j3763x65y3的颜色。

test.js文件中,我编辑了以下内容:

在风格下:

  noUnderline: {
    color: "grey",
    "&:after": {
      borderColor: "grey",
      color: "grey"
    },
  }

并作为相应TextField的属性:

<TextField
          InputLabelProps={{
            shrink: true,
            focused: false
          }}
          InputProps={{
            classes: {
              focused: classes.noUnderline,
              underline: classes.noUnderline
            }
          }}
</TextField>

我没有快速找到正确的类属性来改变InputLabel的聚焦颜色,所以我只是用focused: false禁用焦点,虽然这不是一个非常优雅的解决方案,我不会在生产中使用它。

由于TextField组件是由其他组件组成的组件,因此请查看组件https://material-ui.com/api/text-field/的API文档以及组件的组件。

© www.soinside.com 2019 - 2024. All rights reserved.