Skip to content
Permalink
Browse files

Autocomplete: Delay option just delays request, doesn't clear existin…

…g timeout, therefore not preventing unncessary requests. Calling abort() on existing requests has no effect for JSONP, but even then its unncessary to start a request if the user is still typing. Works fine in 1-8-stable.
  • Loading branch information
jzaefferer committed Sep 24, 2011
1 parent bf51b0e commit cf3e655be19c6a64d21c494a2adbba6526cb6e86
Showing with 2 additions and 1 deletion.
  1. +2 −1 ui/jquery.ui.autocomplete.js
@@ -325,6 +325,7 @@ $.widget( "ui.autocomplete", {

_searchTimeout: function( event ) {
var self = this;
clearTimeout( self.searching );
self.searching = setTimeout(function() {
// only search if the value has changed
if ( self.term != self.element.val() ) {
@@ -384,7 +385,7 @@ $.widget( "ui.autocomplete", {
this._trigger( "close", event );
}
},

_change: function( event ) {
if ( this.previous !== this._value() ) {
this._trigger( "change", event, { item: this.selectedItem } );

0 comments on commit cf3e655

Please sign in to comment.
You can’t perform that action at this time.