【发布时间】:2016-03-03 06:52:24
【问题描述】:
我在 bootstrap 上使用 select 2 主题作为 angular。
默认情况下,它有一个内置的“搜索”来过滤选项行。 我不想要那一行,所以我在网上搜索解决方案。 常见的解决方案是使用 ng-disabled,它在某些浏览器上运行良好,但在手机上仍然会弹出键盘。
我使用了这个 plunker 上描述的“return false”方法: http://plnkr.co/edit/jE0qBpewzvHG5oamB7vQ?p=preview&s=TIKKc2Zmyq5lcvXI
然而,当我在移动设备上打开它(chrome 上的 lg g2)时,我遇到了两个问题:
键盘弹出。
我会打字(奇怪的是我不会打字,但我会打字希伯来语)
pluker 上描述的代码:
<ui-select multiple ng-model="multipleDemo.colors" onkeypress="return false;" theme="select2" ng-disabled="disabled" style="width: 300px;">
<ui-select-match placeholder="Select colors...">
<span ng-if="!disabled">{{$item}}</span>
<span ng-if="disabled">
<a class="glyphicon glyphicon-remove" ng-click="$select.removeChoice($index)" tabindex="-1"></a>
{{$item}}
</span>
</ui-select-match>
<ui-select-choices repeat="color in availableColors | filter:$select.search">
{{color}}
</ui-select-choices>
我不想弹出键盘,也不想让用户打字。
这在原生 android 浏览器上无法重现,只能在 Chrome 上重现。
【问题讨论】:
标签: angularjs twitter-bootstrap mobile ui-select angular-ui-select