Skip to main content

Bug Tracker

Side navigation

Ticket #3296: jquery_autocomplete_space_throws_exception_patch.txt
File jquery_autocomplete_space_throws_exception_patch.txt, 1.1 KB (added by skoon, August 26, 2008 09:16PM UTC)

Patch to fix the bug.

Index: //wafile02/UserHome/skoon/Aptana/Workspace/JQuery Trunk/plugins/autocomplete/jquery.autocomplete.js
===================================================================
--- //wafile02/UserHome/skoon/Aptana/Workspace/JQuery Trunk/plugins/autocomplete/jquery.autocomplete.js	(revision 5838)
+++ //wafile02/UserHome/skoon/Aptana/Workspace/JQuery Trunk/plugins/autocomplete/jquery.autocomplete.js	(working copy)
@@ -234,15 +234,18 @@
 		previousValue = currentValue;
 		
 		currentValue = lastWord(currentValue);
-		if ( currentValue.length >= options.minChars) {
-			$input.addClass(options.loadingClass);
-			if (!options.matchCase)
-				currentValue = currentValue.toLowerCase();
-			request(currentValue, receiveData, hideResultsNow);
-		} else {
-			stopLoading();
-			select.hide();
-		}
+		if (currentValue) {
+			if (currentValue.length >= options.minChars) {
+				$input.addClass(options.loadingClass);
+				if (!options.matchCase) 
+					currentValue = currentValue.toLowerCase();
+				request(currentValue, receiveData, hideResultsNow);
+			}
+			else {
+				stopLoading();
+				select.hide();
+			}
+		};
 	};
 	
 	function trimWords(value) {

Download in other formats:

Original Format