Skip to content
Browse files

Fixes logic flaw with tagLimit

  • Loading branch information...
1 parent 9afa0a8 commit 031615a605c8bd3e2051ac659c8dfd284abe8fbd @jhoff committed Dec 28, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 js/tag-it.js
View
6 js/tag-it.js
@@ -60,7 +60,7 @@
//
// The easiest way to use singleField is to just instantiate tag-it
// on an INPUT element, in which case singleField is automatically
- // set to true, and singleFieldNode is set to that element. This
+ // set to true, and singleFieldNode is set to that element. This
// way, you don't need to fiddle with these options.
singleField: false,
@@ -235,7 +235,7 @@
// Comma/Space/Enter are all valid delimiters for new tags,
// except when there is an open quote or if setting allowSpaces = true.
- // Tab will also create a tag, unless the tag input is empty,
+ // Tab will also create a tag, unless the tag input is empty,
// in which case it isn't caught.
if (
event.which === $.ui.keyCode.COMMA ||
@@ -406,7 +406,7 @@
return false;
}
- if (this.options.tagLimit && this.options.tagLimit >= this._tags().length) {
+ if (this.options.tagLimit && this._tags().length >= this.options.tagLimit) {
this._trigger('onTagLimitExceeded', null, {duringInitialization: duringInitialization});
return false;
}

0 comments on commit 031615a

Please sign in to comment.
Something went wrong with that request. Please try again.