简体   繁体   English

在 MUI 的自动完成中使用 tabIndex 时出错

[英]Error when use tabIndex in Autocomplete of MUI

I want to use tabIndex in autocomplete of MUI using inputProps={{ tabIndex: tabIndex ?? -1 }}我想使用tabIndex使用MUI的自动完成inputProps={{ tabIndex: tabIndex ?? -1 }} inputProps={{ tabIndex: tabIndex ?? -1 }} but when I use this property , and then clicked on dropdown button page disappear can any body help me what is the problem ? inputProps={{ tabIndex: tabIndex ?? -1 }}但是当我使用这个属性,然后点击下拉按钮页面消失时,任何身体都可以帮助我有什么问题吗?

You also need to spread the params.inputProps from the Autocomplete :您还需要从Autocomplete传播params.inputProps

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

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

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