Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit e1f682b

Browse files
fix for single select with simple tags
1 parent d4c2f2f commit e1f682b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

examples/demo-tagging.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,15 @@ <h3>Tagging without multiple</h3>
130130
</ui-select>
131131
<p>Selected: {{person.selected}}</p>
132132

133+
<h3>Tagging without multiple, with simple strings</h3>
134+
<ui-select tagging="true" tagging-label="('new')" ng-cloak ng-model="color.selected" theme="bootstrap" style="width: 800px;" title="Choose a color">
135+
<ui-select-match placeholder="Select color...">{{$select.selected}}</ui-select-match>
136+
<ui-select-choices repeat="color in availableColors | filter: $select.search">
137+
<div ng-bind-html="color | highlight: $select.search"></div>
138+
</ui-select-choices>
139+
</ui-select>
140+
<p>Selected: {{color.selected}}</p>
141+
133142

134143
<div style="height:500px"></div>
135144

src/select.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@
827827
return false;
828828
}
829829
var hasDupe = arr.filter( function (origItem) {
830-
if ( ctrl.search.toUpperCase() === undefined ) {
830+
if ( ctrl.search.toUpperCase() === undefined || origItem === undefined ) {
831831
return false;
832832
}
833833
return origItem.toUpperCase() === ctrl.search.toUpperCase();

0 commit comments

Comments
 (0)