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

Commit 73cf684

Browse files
committed
Merge pull request #308 from leonkenneth/focus-state
Added `token-input-focused` CSS class to mimic focused state.
2 parents 985d095 + 40eb484 commit 73cf684

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/jquery.tokeninput.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ var DEFAULT_CLASSES = {
6666
dropdownItem2: "token-input-dropdown-item2",
6767
selectedDropdownItem: "token-input-selected-dropdown-item",
6868
inputToken: "token-input-input-token",
69+
focused: "token-input-focused",
6970
disabled: "token-input-disabled"
7071
};
7172

@@ -203,10 +204,12 @@ $.TokenList = function (input, url_or_data, settings) {
203204
if (settings.tokenLimit === null || settings.tokenLimit !== token_count) {
204205
show_dropdown_hint();
205206
}
207+
token_list.addClass(settings.classes.focused);
206208
})
207209
.blur(function () {
208210
hide_dropdown();
209211
$(this).val("");
212+
token_list.removeClass(settings.classes.focused);
210213
})
211214
.bind("keyup keydown blur update", resize_input)
212215
.keydown(function (event) {

0 commit comments

Comments
 (0)