Skip to content

Commit 941c8ee

Browse files
author
Tomas Kirda
committed
Don't perform lookup if onSearchStart returns false. Fixes devbridge#60.
1 parent 41543d9 commit 941c8ee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/jquery.autocomplete.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,9 @@
390390
that.suggest();
391391
} else if (!that.isBadQuery(q)) {
392392
options.params[options.paramName] = q;
393-
options.onSearchStart.call(that.element, options.params);
393+
if (options.onSearchStart.call(that.element, options.params) === false) {
394+
return;
395+
}
394396
$.ajax({
395397
url: options.serviceUrl,
396398
data: options.params,

0 commit comments

Comments
 (0)