首页 > 解决方案 > 在 MUI 的自动完成中使用 tabIndex 时出错

问题描述

我想tabIndex在 MUI 的自动完成中使用,inputProps={{ tabIndex: tabIndex ?? -1 }}但是当我使用这个属性时,然后单击下拉按钮页面消失,任何机构都可以帮助我有什么问题吗?

标签: reactjsautocompletematerial-uitabindex

解决方案


您还需要传播params.inputProps来自Autocomplete

<TextField
  {...params}
  inputProps={{ ...params.inputProps, tabIndex: 1 }}
  label="freeSolo"
/>

推荐阅读