minchars bug
April 29, 2008 - 7:41pm — ngmaloney
To:
...and that seemed to solve the problem. I *think* it works because keydown is registered before the form value is part of the DOM, where keyup is after the data has been entered. Enclosed is the patched version.
| Project: | jquery.suggest, a "Google Suggest"-like autocompleter |
| Version: | 1.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Description
if the minchars option is set to 1 the suggest will not display until 2 characters have been entered. After that, results will display on 1 character. I believe I have a work around, but it needs further testing. Attached is a patched version.
I removed the event handlers in .suggest function from
// I really hate browser detection, but I don't see any other way
if ($.browser.mozilla)
$input.keypress(processKey); // onkeypress repeats arrow keys in Mozilla/Opera
else
$input.keydown(processKey); // onkeydown repeats arrow keys in IE/SafariTo:
$input.keyup(processKey);...and that seemed to solve the problem. I *think* it works because keydown is registered before the form value is part of the DOM, where keyup is after the data has been entered. Enclosed is the patched version.
| Attachment | Size |
|---|---|
| jquery.suggest.js__0.txt | 6.56 KB |
