如何在jsx中使用tabIndex?

问题描述 投票:0回答:1

根据react docs,这应该有效。

<div tabIndex="0"></div>

但是当我尝试此操作时,它不起作用现在我的输入实际上已被跳过!

我在这里做错了什么?

<CustomRadio
tabIdex='0'/>
<CustomCheckbox
tabIdex='1'/>
<input
tabIndex='2'/>
javascript html reactjs jsx tabindex
1个回答
0
投票

您两次输入了tabIndex,但没有n,它应该是:

<CustomRadio
tabIndex='0'/>
<CustomCheckbox
tabIndex='1'/>
<input
tabIndex='2'/>

我认为您可能还需要将这些道具传递到组件中,传递给基础元素

© www.soinside.com 2019 - 2024. All rights reserved.