Skip to content

Commit 8d0b422

Browse files
author
Tomas Kirda
committed
Cancel current request when disabling autocomplete. Closes #107
1 parent d1ee9c0 commit 8d0b422

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/jquery.autocomplete.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,11 @@
229229
},
230230

231231
disable: function () {
232-
this.disabled = true;
232+
var that = this;
233+
that.disabled = true;
234+
if (that.currentRequest) {
235+
that.currentRequest.abort();
236+
}
233237
},
234238

235239
enable: function () {

0 commit comments

Comments
 (0)