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

Commit b329acd

Browse files
committed
Merge branch 'master' of github.com:loopj/jquery-tokeninput
2 parents 1538300 + 8b44ebd commit b329acd

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.DS_Store

6 KB
Binary file not shown.

src/jquery.tokeninput.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ var DEFAULT_SETTINGS = {
2929
animateDropdown: true,
3030
onResult: null,
3131
onAdd: null,
32-
onDelete: null
32+
onDelete: null,
33+
idPrefix: "token-input-"
3334
};
3435

3536
// Default classes to use when theming
@@ -162,13 +163,15 @@ $.TokenList = function (input, url_or_data, settings) {
162163
.css({
163164
outline: "none"
164165
})
166+
.attr("id", settings.idPrefix + input.id)
165167
.focus(function () {
166168
if (settings.tokenLimit === null || settings.tokenLimit !== token_count) {
167169
show_dropdown_hint();
168170
}
169171
})
170172
.blur(function () {
171173
hide_dropdown();
174+
$(this).val("");
172175
})
173176
.bind("keyup keydown blur update", resize_input)
174177
.keydown(function (event) {

0 commit comments

Comments
 (0)