Material-ui 自定义输入搜索类型的默认清除按钮

Material-ui custom the default clear button on input search type

我想知道是否可以更改 material 中搜索类型输入的默认清除按钮的颜色。

我在说这个'X':

这是我的 jsx:

<InputBase
  placeholder="Search..."
  type="search"
  onChange={(e) => handleChange(filterChoiceRef.current, e)}
  autoFocus={true}
  size="large"
/>

如果不可能,我可以做一个定制的,但我希望可以。

您可以使用 InputAdornments 并传递颜色 属性 -

这里的工作代码沙箱 - https://codesandbox.io/s/material-demo-8tbo4?file=/demo.js