Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Commit

Permalink
won't duplicate entry if hit tokenLimit with allowCustomEntry
Browse files Browse the repository at this point in the history
  • Loading branch information
vdepizzol committed May 19, 2011
1 parent bbe0c18 commit f99ffe7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/jquery.tokeninput.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,16 +510,16 @@ $.TokenList = function (input, url_or_data, settings) {

// Insert the new tokens
insert_token(li_data);

// Clear input box
input_box.val("");

// Check the token limit
if(settings.tokenLimit !== null && token_count >= settings.tokenLimit) {
input_box.hide();
hide_dropdown();
} else {
input_box.focus();

// Clear input box
input_box.val("");

// Don't show the help dropdown, they've got the idea
hide_dropdown();
Expand Down

0 comments on commit f99ffe7

Please sign in to comment.