cannot navigate angular-ui boostrap typeahead with specific height with keyboard

戏子无情 提交于 2019-12-12 14:17:44

问题


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.

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

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

Any ideas?


回答1:


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



来源:https://stackoverflow.com/questions/21696407/cannot-navigate-angular-ui-boostrap-typeahead-with-specific-height-with-keyboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!