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

fix for single select with simple tags #671

Merged
merged 1 commit into from
Feb 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions examples/demo-tagging.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ <h3>Tagging without multiple</h3>
</ui-select>
<p>Selected: {{person.selected}}</p>

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


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

Expand Down
2 changes: 1 addition & 1 deletion src/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@
return false;
}
var hasDupe = arr.filter( function (origItem) {
if ( ctrl.search.toUpperCase() === undefined ) {
if ( ctrl.search.toUpperCase() === undefined || origItem === undefined ) {
return false;
}
return origItem.toUpperCase() === ctrl.search.toUpperCase();
Expand Down