Skip to content

Commit

Permalink
Allow creation of tags when autocomplete menu is open. Only disable c…
Browse files Browse the repository at this point in the history
…reation when autoFocus is true. Also close the autocomplete menu when creating a tag.
  • Loading branch information
jpotterm committed Aug 18, 2013
1 parent d416408 commit 3557675
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/tag-it.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@
}

// Autocomplete will create its own tag from a selection and close automatically.
if (!that.tagInput.data('autocomplete-open')) {
if (!(that.options.autocomplete.autoFocus && that.tagInput.data('autocomplete-open'))) {
that.tagInput.autocomplete('close');
that.createTag(that._cleanedInput());
}
}
Expand Down

0 comments on commit 3557675

Please sign in to comment.