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

If tagging mode is activated, do not check values #683

Closed
Closed
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
20 changes: 20 additions & 0 deletions test/select.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1725,6 +1725,26 @@ describe('ui-select tests', function() {

expect(el.scope().$select.multiple).toBe(true);
});

it('should preserve the model if tagging is enabled on select multiple', function() {
scope.selection.selectedMultiple = ["I am not on the list of choices"];

var el = compileTemplate(
'<ui-select multiple="multiple" tagging ng-model="selection.selectedMultiple" theme="bootstrap" style="width: 800px;"> \
<ui-select-match placeholder="Pick one...">{{$item.name}} &lt;{{$item.email}}&gt;</ui-select-match> \
<ui-select-choices repeat="person.email as person in people | filter: $select.search"> \
<div ng-bind-html="person.name | highlight: $select.search"></div> \
<div ng-bind-html="person.email | highlight: $select.search"></div> \
</ui-select-choices> \
</ui-select> \
'
);

scope.$digest();

expect(scope.selection.selectedMultiple)
.toEqual(["I am not on the list of choices"]);
});

it('should allow paste tag from clipboard', function() {
scope.taggingFunc = function (name) {
Expand Down