aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.autocomplete.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js
index 6b19c4401..e8796e41e 100644
--- a/ui/jquery.ui.autocomplete.js
+++ b/ui/jquery.ui.autocomplete.js
@@ -221,10 +221,14 @@ $.widget( "ui.autocomplete", {
} else if ( typeof this.options.source === "string" ) {
url = this.options.source;
this.source = function( request, response ) {
+ if (self.xhr) {
+ self.xhr.abort();
+ }
self.xhr = $.getJSON( url, request, function( data, status, xhr ) {
if ( xhr === self.xhr ) {
- response.apply( this, arguments );
+ response( data );
}
+ self.xhr = null;
});
};
} else {