1

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

4

1 回答 1

2

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

<TextField
  {...params}
  inputProps={{ ...params.inputProps, tabIndex: 1 }}
  label="freeSolo"
/>
于 2021-10-28T13:42:43.763 回答