更改文本字段的背景颜色 onFocus mui

时间:2021-05-24 18:32:38

标签: css reactjs material-ui jss

  1. enter image description here

========================================

我试图在日历打开时更改输入类型日期的背景颜色,但无法弄清楚。这是代码

  dateInputRoot: {
    '&:hover': {
      backgroundColor: '#EBEBEB',
    },

    '&:active': {
      backgroundColor: '#fff',
      borderColor: '#2EFF22',
      borderWidth: 1,
    },
  },
  dateInput: {
    border: 0,
  },

               <TextField
                  margin="dense"
                  type="date"
                  variant="outlined"
                  value={closeDate}
                  placeholder=""
                  fullWidth
                  style={{ paddingLeft: 0 }}
                  onChange={(e) => {
                    setCloseDate(e.target.value);
                  }}
                  className={classes.dateInputRoot}
                  InputProps={{
                    classes: { notchedOutline: classes.dateInput },
                  }}
                />

问题在于活动选择器,它仅在我按下鼠标按钮之前更改背景,也没有应用边框宽度。我想在日历打开时为白色和一些边框提供背景。 任何帮助请

0 个答案:

没有答案