Skip to content

Commit

Permalink
Merge pull request #372 from ryanwersal/prevent-debounce
Browse files Browse the repository at this point in the history
Allow preventing onSearchChange debounce by specifying null for loadThrottle
  • Loading branch information
brianreavis committed Apr 30, 2014
2 parents b7dcb1d + 2cce7ce commit fa897f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ $(function() {
</tr>
<tr>
<td valign="top"><code>loadThrottle</code></td>
<td valign="top">The number of milliseconds to wait before requesting options from the server.</td>
<td valign="top">The number of milliseconds to wait before requesting options from the server or null. If null, throttling is disabled.</td>
<td valign="top"><code>int</code></td>
<td valign="top"><code>300</code></td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion src/selectize.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var Selectize = function($input, settings) {
userOptions : {},
items : [],
renderCache : {},
onSearchChange : debounce(self.onSearchChange, settings.loadThrottle)
onSearchChange : settings.loadThrottle === null ? self.onSearchChange : debounce(self.onSearchChange, settings.loadThrottle)
});

// search system
Expand Down

0 comments on commit fa897f6

Please sign in to comment.