简体   繁体   English

如何不旋转 mui 自动完成弹出图标?

[英]How not to spin mui autocomplete popup icon?

how not to spin search icon after open autocomplete input?打开自动完成输入后如何不旋转搜索图标?

<Autocomplete
  popupIcon={<Search />}
  onChange={(e, value) => handleFound(value)}
  options={['0', '2', '3', '1']}
  sx={{ width: '100%' }}
  renderInput={(params) =>
    <TextField {...params} placeholder={'type anything...'} />
  }
/>

You need to stop the rotation from the popup indicator styles, like this:您需要从弹出指示器 styles 停止旋转,如下所示:

<Autocomplete
  popupIcon={<Search />}
  onChange={(e, value) => handleFound(value)}
  options={["0", "2", "3", "1"]}
  sx={{
    width: "100%",
    "& .MuiAutocomplete-popupIndicator": { transform: "none" },
  }}
  renderInput={(params) => (
    <TextField {...params} placeholder={"type anything..."} />
  )}
/>

Note that this is not the only solution but in my opinion is the fastest...请注意,这不是唯一的解决方案,但我认为这是最快的...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM