Skip to content
This repository has been archived by the owner on May 9, 2018. It is now read-only.

"maxTags" invalid when leave focus to add a tag. #85

Open
wudiipdang opened this issue May 18, 2013 · 1 comment
Open

"maxTags" invalid when leave focus to add a tag. #85

wudiipdang opened this issue May 18, 2013 · 1 comment

Comments

@wudiipdang
Copy link

No description provided.

@ianbailey
Copy link

You can fix this by editing row 270

if (self.options.allowNewTags) { }

At the minute, if allowNewTags is true, it'll add the tag regardless if self.options.maxTags has been hit or not.

I've edited it to the following:

if (!self.options.allowNewTags || (self.options.maxTags !== undefined && self.tagsArray.length == self.options.maxTags)) { 
}
else if (self.options.allowNewTags && $(this).val().length >= self.options.minLength) {
}

Which is a copy+paste of some code further up in the file.

HTH

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants