为什么tabindex =' - 1'阻止键盘 [英] Why tabindex='-1' prevents keyboard
问题描述
在< div>
上存在
tabindex =' - 1'
/ code>对于启动时的模式,它会完全停止来自键盘的输入。我原以为数据属性 data-keyboard =false
会是罪魁祸首,但事实并非如此。
我的问题
为什么tabindex =' - 1'会阻止键盘输入。除此之外,其目的是什么? 解决方案 tabindex
设置页面上的editable-elements将使用选项卡
键迭代的顺序。 -1
看起来像是一个合理的值,从这个意义上说,使一个元素无法接近。
更多信息: http://webaim.org/techniques/keyboard/tabindex
After many hours trying to locate why a keyboard input would not work within a bootstrap modal, i have finally managed to identify the issue.. and it was something i would have never of thought of, but found it by pure process of elimination.
By having tabindex='-1'
present on the <div>
for the modal from bootstrap, it completely stops the input from the keyboard. I would have thought the data-attribute data-keyboard="false"
would have been the culprit however it was not.
My Question
Why does tabindex='-1' prevent keyboard input. And what would be its purpose other than that?
解决方案 tabindex
sets the order that editable-elements on the page will be iterated using the tab
key. -1
seems like a reasonable value, from that sense, to make an element unapproachable.
For more information: http://webaim.org/techniques/keyboard/tabindex
这篇关于为什么tabindex =' - 1'阻止键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文