我不确定是TB引入了一个新错误还是我,但它适用于Chrome和IE,但在Firefox中不起作用。
当显示建议时,TypeAhead 会跳过向上或向下键的所有其他值。
<input type="text" class="manufacturer typeahead" placeholder="manufacturer">
<script type="text/javascript">
$('.manufacturer.typeahead').typeahead({
"source":['manufacturer 1','manufacturer 2','manufacturer 3', 'manufacturer 4','manufacturer 5','manufacturer 6','manufacturer 7','manufacturer 8'],
"items":8
})
<script>
推特引导 2.2.1
j查询 1.8.3
火狐 16.0.2
无论如何打开了错误:https://github.com/twbs/bootstrap/issues/5943
演示2(开始键入"m")或TB站点的官方提前输入演示(开始输入"a")
这确实是一个错误。这是修复:
, move: function (e) {
if (!this.shown) return
switch(e.keyCode) {
case 9: // tab
case 13: // enter
case 27: // escape
e.preventDefault()
break
case 38: // up arrow
e.preventDefault()
if (e.type=='keydown') this.prev()
break
case 40: // down arrow
e.preventDefault()
if (e.type=='keydown') this.next()
break
}