从覆盖的输入中打开选择列表-物料用户界面

时间:2020-07-17 06:54:41

标签: reactjs material-ui

  <Select
    value={text}
    onChange={handleChange}
    label={formatMessage(messages.dateFilter)}
    input={
      <Box display="flex" className={classes.input}>
        <Calendar />
        <Typography variant="caption">{text}</Typography>
      </Box>
    }
  >
    {items.map(entity => {
      return (
        <MenuItem value={entity.text}>
          <Box display="flex" justifyContent="space-between">
            <Typography variant="caption">{entity.text}</Typography>
            {text === entity.text && <CheckMark />}
          </Box>
        </MenuItem>
      )
    })}
  </Select>

如您所见,我尝试覆盖Select列表中的输入属性,但是现在当我单击此字段时,它没有打开选择列表弹出窗口。我也尝试过使用open属性(将其设置为true),但是它也不起作用。我该如何解决?

"@material-ui/core": "4.5.2",

Edit competent-greider-nsyvz

0 个答案:

没有答案