Skip to content
Open
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
5 changes: 5 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ Optionally set a *placeholder* attribute on the `input` that gets created for ta

Defaults to *null*

### maxTagLength (integer)
Optionally set a *maxlength* attribute on the tag-it `input` that gets created.

Defaults to *null*


## Events

Expand Down
7 changes: 7 additions & 0 deletions js/tag-it.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@
onTagClicked : null,
onTagLimitExceeded : null,

// Optionally set a maxlength attribute on the tag-it input
maxTagLength: null,


// DEPRECATED:
//
Expand Down Expand Up @@ -136,6 +139,10 @@
this.tagInput.attr('placeholder', this.options.placeholderText);
}

if (this.options.maxTagLength) {
this.tagInput.attr('maxlength', this.options.maxTagLength);
}

if (!this.options.autocomplete.source) {
this.options.autocomplete.source = function(search, showChoices) {
var filter = search.term.toLowerCase();
Expand Down