Skip to content
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.

Commit

Permalink
feat(tagsInput): Change allowedTagsPattern's default value
Browse files Browse the repository at this point in the history
Change allowed-tags-pattern's default value to a less restrictive
regular expression (.+).

Closes #76.
  • Loading branch information
mbenford committed Feb 23, 2014
1 parent 7f9e8bb commit 8702909
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/tags-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ tagsInput.directive('tagsInput', function($timeout, $document, tagsInputConfig)
addOnSpace: [Boolean, false],
addOnComma: [Boolean, true],
addOnBlur: [Boolean, true],
allowedTagsPattern: [RegExp, /^[a-zA-Z0-9\s]+$/],
allowedTagsPattern: [RegExp, /.+/],
enableEditingLastTag: [Boolean, false],
minTags: [Number],
maxTags: [Number],
Expand Down
4 changes: 2 additions & 2 deletions test/tags-input.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -544,12 +544,12 @@ describe('tags-input directive', function() {
expect($scope.tags).toEqual([]);
});

it('initializes the option to ^[a-zA-Z0-9\\s]+$', function() {
it('initializes the option to .+', function() {
// Arrange/Act
compile();

// Assert
expect(isolateScope.options.allowedTagsPattern.toString()).toBe('/^[a-zA-Z0-9\\s]+$/');
expect(isolateScope.options.allowedTagsPattern.toString()).toBe('/.+/');
});
});

Expand Down
1 change: 0 additions & 1 deletion test/test-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
<body ng-controller="Ctrl">
<tags-input class="foo" ng-model="tags" limit-tags="5"
replace-spaces-with-dashes="true"
allowed-tags-pattern="^[a-zA-Z0-9\s<@\.]+$"
enable-editing-last-tag="true"
placeholder="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
min-tags="3">
Expand Down

0 comments on commit 8702909

Please sign in to comment.