Skip to content
This repository was archived by the owner on Sep 10, 2023. It is now read-only.

Commit 3135424

Browse files
committed
allowFreeTagging set to false not work fix
Original allowFreeTagging set to false not work, when set allowFreeTagging to false, user press COMMA or ENTER the free tag will be added, this behavior is not "allowFreeTagging : false", should be fix.
1 parent 39353a2 commit 3135424

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/jquery.tokeninput.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,11 @@ $.TokenList = function (input, url_or_data, settings) {
333333
add_token($(selected_dropdown_item).data("tokeninput"));
334334
hidden_input.change();
335335
} else {
336-
add_freetagging_tokens();
336+
if ($(input).data("settings").allowFreeTagging) {
337+
add_freetagging_tokens();
338+
} else {
339+
$(this).val("");
340+
}
337341
event.stopPropagation();
338342
event.preventDefault();
339343
}

0 commit comments

Comments
 (0)