无法使用键盘导航具有特定高度的 angular-ui boostrap typeahead [英] cannot navigate angular-ui boostrap typeahead with specific height with keyboard

查看:21
本文介绍了无法使用键盘导航具有特定高度的 angular-ui boostrap typeahead的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我认为这比 angular-ui 更像是引导程序问题,但我为此花了 2 个晚上,却找不到隧道尽头的光.

So, I think it's more a bootsrap issue than angular-ui, but I spent 2 nights over this and I cannot find the light at the end of the tunnel.

这是 plunkr :http://plnkr.co/edit/n39LVjbHQzmcwGkk2dR1?p=preview

Here's the plunkr : http://plnkr.co/edit/n39LVjbHQzmcwGkk2dR1?p=preview

搜索x",然后尝试使用箭头键向下移动.项目将被选中,但不会获得焦点.

Search for "x" and then try to go down using the arrow keys. Items will be selected, but they will not gain focus.

有什么想法吗?

推荐答案

这里有一个解决方案.我向 typeahead li 元素 shouldFocus 添加了另一个指令,该指令监视其活动值的变化.当它这样做时,它会对该元素调用 scrollIntoView.

Here is a solution. I added another directive to the typeahead li element shouldFocus that watches for its active value to change. When it does it calls scrollIntoView on that element.

我想这被认为是一种黑客行为,但如果预先输入允许动态模板,从标记设置,那么这将是一个有效的修复.

I guess this is considered a hack, but If typeahead allowed for dynamic templates, set from markup, then it would be a valid fix.

http://plnkr.co/edit/vzLHFqkHPUFCaaosVt5w?p=preview

这篇关于无法使用键盘导航具有特定高度的 angular-ui boostrap typeahead的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆