Skip to content

Commit

Permalink
Select option with TAB key
Browse files Browse the repository at this point in the history
A client asked me they want to able to select an option by pressing tab. I thought it would be nice if Selectize has this feature by default.
  • Loading branch information
o0x2a committed Jan 20, 2014
1 parent 1841f25 commit b320b6d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/selectize.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,9 @@ $.extend(Selectize.prototype, {
self.advanceSelection(1, e);
return;
case KEY_TAB:
if (self.isOpen && self.$activeOption) {
self.onOptionSelect({currentTarget: self.$activeOption});
}
if (self.settings.create && self.createItem()) {
e.preventDefault();
}
Expand Down

0 comments on commit b320b6d

Please sign in to comment.