[autocomplete] - incorrectly refocussing?

[autocomplete] - incorrectly refocussing?


Forgive me if this is the wrong spot for this but I figured I'd throw
this out here before filing an issue in the bug tracker.
I'm using jquery.autocomplete plugin version 1.0.2
* Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar,
Jörn Zaefferer
I have a form with an autocomplete enabled textfield, a textarea, and
a button. When the button is clicked the textfield input value is used
to retrieve something from the server and place it in the textarea
leaving the focus on the textarea. The problem seems to be if the
button is clicked while an autocomplete request is out and the
action(insert into textarea) completes before the autocomplete request
returns then the focus is taken off my textarea and put back on the
textfield.
As best I can tell, it works correctly with the following patch.
--- jquery.autocomplete.js 2008-08-29 14:00:51.000000000 -0400
+++ jquery.autocomplete.patched.js 2008-08-29 13:11:25.000000000
-0400
@@ -305,7 +305,7 @@
}
);
}
- if (wasVisible)
+ if (wasVisible && hasFocus)
// position cursor at end of input field
$.Autocompleter.Selection(input,
input.value.length, input.value.length);
};
@@ -756,4 +756,4 @@
field.focus();
};
-})(jQuery);
\ No newline at end of file
+})(jQuery);

































    • Topic Participants

    • lenny