【发布时间】:2015-07-30 09:57:02
【问题描述】:
当为 AngularJS 使用多个版本的 UI-Select 时,一旦用户按下回车,表单就会提交。许多用户开始输入标签并按回车键选择它并搜索新标签。但是一旦用户按下输入,表单就会被提交。
禁用此功能的最佳“Angular”方法是什么?
<form ng-submit="submit()">
<ui-select multiple ng-model="multipleDemo.colors" theme="select2" style="width: 300px;">
<ui-select-match placeholder="Select colors...">{{$item}}</ui-select-match>
<ui-select-choices repeat="color in availableColors | filter:$select.search">
{{color}}
</ui-select-choices>
</ui-select>
<p>Selected: {{multipleDemo.colors}}</p>
<div style="height:500px"></div>
</form>
【问题讨论】:
标签: angularjs ui-select2 ui-select angularjs-select2