Skip to content

Commit d3e5b67

Browse files
committed
Merge pull request #371 from ryanwersal/select-on-tab-config
Add selectOnTab config option
2 parents d6a6f53 + de77d4c commit d3e5b67

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

docs/usage.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ $(function() {
114114
<td valign="top"><code>boolean</code></td>
115115
<td valign="top"><code>false</code></td>
116116
</tr>
117+
<tr>
118+
<td valign="top"><code>selectOnTab</code></td>
119+
<td valign="top">If true, the tab key will choose the currently selected item.</td>
120+
<td valign="top"><code>boolean</code></td>
121+
<td valign="top"><code>false</code></td>
122+
</tr>
117123
<tr>
118124
<th valign="top" colspan="4" align="left"><a href="#data_searching" name="data_searching">Data / Searching</a></th>
119125
</tr>

src/defaults.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Selectize.defaults = {
1212
maxItems: null,
1313
hideSelected: null,
1414
addPrecedence: false,
15+
selectOnTab: false,
1516
preload: false,
1617

1718
scrollDuration: 60,

src/selectize.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ $.extend(Selectize.prototype, {
431431
self.advanceSelection(1, e);
432432
return;
433433
case KEY_TAB:
434-
if (self.isOpen && self.$activeOption) {
434+
if (self.settings.selectOnTab && self.isOpen && self.$activeOption) {
435435
self.onOptionSelect({currentTarget: self.$activeOption});
436436
}
437437
if (self.settings.create && self.createItem()) {

0 commit comments

Comments
 (0)