Skip to content

Commit fa897f6

Browse files
committed
Merge pull request selectize#372 from ryanwersal/prevent-debounce
Allow preventing onSearchChange debounce by specifying null for loadThrottle
2 parents b7dcb1d + 2cce7ce commit fa897f6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ $(function() {
9292
</tr>
9393
<tr>
9494
<td valign="top"><code>loadThrottle</code></td>
95-
<td valign="top">The number of milliseconds to wait before requesting options from the server.</td>
95+
<td valign="top">The number of milliseconds to wait before requesting options from the server or null. If null, throttling is disabled.</td>
9696
<td valign="top"><code>int</code></td>
9797
<td valign="top"><code>300</code></td>
9898
</tr>

src/selectize.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var Selectize = function($input, settings) {
4444
userOptions : {},
4545
items : [],
4646
renderCache : {},
47-
onSearchChange : debounce(self.onSearchChange, settings.loadThrottle)
47+
onSearchChange : settings.loadThrottle === null ? self.onSearchChange : debounce(self.onSearchChange, settings.loadThrottle)
4848
});
4949

5050
// search system

0 commit comments

Comments
 (0)