问题描述
经过许多小时试图找出为什么键盘输入不能在引导模式下工作,我终于设法找出问题..这是我永远不会想到的,但通过纯粹的过程发现它淘汰。 $ b在< div> 上存在 tabindex =' - 1' / code>对于启动时的模式,它会完全停止来自键盘的输入。我原以为数据属性 data-keyboard =false会是罪魁祸首,但事实并非如此。
我的问题
为什么tabindex =' - 1'会阻止键盘输入。除此之外,其目的是什么?
tabindex 设置页面上的editable-elements将使用选项卡键迭代的顺序。 -1 看起来像是一个合理的值,从这个意义上说,使一个元素无法接近。
更多信息:
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 QuestionWhy 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'阻止键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!