Home > Programming, Uncategorized, Webdevelopment > jQuery 1.3.2. autocomplete – keydown bug

jQuery 1.3.2. autocomplete – keydown bug

February 3rd, 2010 Leave a comment Go to comments

Not using jQuery version 1.3.2? Skip this post.

Working with the jquery autocomplete-complete plugin today made me notice the control performs some weird behavior when you try to unbind or unautocomplete.

In a nutshell: renewing the autocomplete plugin will not unbind the “keydown” event. This is actually due to a bug in jQuery 1.3.2.

What can we do about it?

  • Change your version of the jQuery plugin (1.4 fixed the “keydown” bug)
  • Or manually update the autocomplete plugin to support jQuery 1.3.2

Where can you update the autocomplete to support 1.3.2? Open your file and look for the following code:


}).bind("unautocomplete", function() {
	select.unbind();
	$input.unbind();
	$(input.form).unbind(".autocomplete");
});

Just add one line of code before the $input.unbind() method:


}).bind("unautocomplete", function() {
	select.unbind();
	$input.unbind("keydown.autocomplete");
	$input.unbind();
	$(input.form).unbind(".autocomplete");
});

Presto!

(ps: Working in Visual Studio? make sure you modify the jquery.autocomplete.min.js file, this file is used when your application runs on the webserver.)

  1. Romz
    February 5th, 2010 at 11:56 | #1

    Thank you so much for this fix I searched to solve for a while ;)

  2. fuqi7758521
    March 16th, 2010 at 02:08 | #2

    i also catch this problem , i follow this method ,,but it does not work

  3. fuqi7758521
    March 16th, 2010 at 03:29 | #3

    it’s my fault,you are right .thank you

  4. Jeremy
    April 15th, 2010 at 15:03 | #4

    Thank you very much – I was running out of options until I found this post. That fix worked perfectly.

  1. No trackbacks yet.

Additional comments powered by BackType