Skip to content

Commit

Permalink
Merge pull request #371 from ryanwersal/select-on-tab-config
Browse files Browse the repository at this point in the history
Add selectOnTab config option
  • Loading branch information
brianreavis committed Apr 30, 2014
2 parents d6a6f53 + de77d4c commit d3e5b67
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ $(function() {
<td valign="top"><code>boolean</code></td>
<td valign="top"><code>false</code></td>
</tr>
<tr>
<td valign="top"><code>selectOnTab</code></td>
<td valign="top">If true, the tab key will choose the currently selected item.</td>
<td valign="top"><code>boolean</code></td>
<td valign="top"><code>false</code></td>
</tr>
<tr>
<th valign="top" colspan="4" align="left"><a href="#data_searching" name="data_searching">Data / Searching</a></th>
</tr>
Expand Down
1 change: 1 addition & 0 deletions src/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Selectize.defaults = {
maxItems: null,
hideSelected: null,
addPrecedence: false,
selectOnTab: false,
preload: false,

scrollDuration: 60,
Expand Down
2 changes: 1 addition & 1 deletion src/selectize.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ $.extend(Selectize.prototype, {
self.advanceSelection(1, e);
return;
case KEY_TAB:
if (self.isOpen && self.$activeOption) {
if (self.settings.selectOnTab && self.isOpen && self.$activeOption) {
self.onOptionSelect({currentTarget: self.$activeOption});
}
if (self.settings.create && self.createItem()) {
Expand Down

0 comments on commit d3e5b67

Please sign in to comment.