Skip to content

Commit

Permalink
Another tokenlimit fix
Browse files Browse the repository at this point in the history
  • Loading branch information
loopj committed Mar 20, 2011
1 parent cf83b6c commit 55dbf37
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/jquery.tokeninput.js
Expand Up @@ -383,18 +383,18 @@ $.TokenList = function (input, settings) {
// Insert the new tokens
insert_token(li_data.id, li_data.name);

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

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

// Clear input box and make sure it keeps focus
input_box
.val("")
.focus();

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

Expand Down

0 comments on commit 55dbf37

Please sign in to comment.