Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added allowCommas option #374

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion js/tag-it.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@

// When enabled, quotes are unneccesary for inputting multi-word tags.
allowSpaces: false,
// When enabled, comma key won't trigger completion of a tag
allowCommas: false,

// The below options are for using a single field instead of several
// for our form values.
Expand Down Expand Up @@ -241,7 +243,7 @@
// 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 && event.shiftKey === false) ||
((event.which === $.ui.keyCode.COMMA && that.options.allowCommas == false) && event.shiftKey === false) ||
event.which === $.ui.keyCode.ENTER ||
(
event.which == $.ui.keyCode.TAB &&
Expand Down