Angular bootstrap typeahead滚动结果不能处理键盘

时间:2015-06-21 05:48:34

标签: angularjs angular-ui-bootstrap

我有一个typeahead,我想限制结果的高度,并允许用户滚动并进行选择。

我通过覆盖模板并使用max-height和overflow-y来完成这项工作。虽然当用户使用键盘在列表中移动时,这会产生效果,但列表实际上并不滚动。

这是我的模板覆盖:

<script id="template/typeahead/typeahead.html" type="text/ng-template">
  <ul class="typeahead dropdown-menu results" ng-style="{display: isOpen()&&'block' || 'none', top: position.top+'px', left: position.left+'px'}">
    <li ng-repeat="match in matches" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-class-odd="'odd'">
        <a tabindex="-1" ng-click="selectMatch($index)" ng-bind-html-unsafe="match.label | typeaheadHighlight:query"></a>
    </li>
  </ul>    
</script>  

CSS:

.results {
  max-height: 200px;
  overflow-y: auto;
}

Here's my plunkr demoing the issue

0 个答案:

没有答案
相关问题