Angularstrap typeaheads弹出选择列表错误

时间:2015-04-09 16:41:00

标签: angularjs typeahead.js angular-strap

我不确定这是否是一个错误,所以对于角带,当我输入不在选择列表中的内容时,当我点击并再次单击它时,将弹出选择列表。但是,如果我在选择列表中选择项目并单击并单击返回,则不会显示选择列表。是否有任何解决方案可以显示选择列表?

<div class="form-group">
    <label>Icon</label>
    <input type="text" class="form-control" ng-model="selectedIcon" data-min-length="0" data-html="1" data-auto-select="true" data-animation="am-flip-x" bs-options="icon for icon in icons" placeholder="Enter icon" bs-typeahead>
</div>

吸虫在这里:

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

所以我想要的功能就是当我在Icon输入中输入Alaska并从选择列表中选择Alaska时,当我点击并单击后面时,将显示选择列表。感谢。

更新

var isVisible = typeahead.$isVisible();
isVisible && typeahead.update(values);
// Do not re-queue an update if a correct value has been selected
if(values.length === 1 && values[0].value === newValue) return;
!isVisible && typeahead.update(values);
// Queue a new rendering that will leverage collection loading
controller.$render();

角带代码似乎不允许重新排列所选值。所以对于我的问题,如果我使用ng-blur来触发替换对象的函数,问题就解决了。我不确定为什么会这样实现。

0 个答案:

没有答案
相关问题