Thanks a bunch. I had to change on() to bind() since we're stuck at my company on 1.4.2 unfortunately.
I did notice it does something a bit fishy though, when i select a result, it closes menu, then pops up the menu again with that one result.
Because after you click your selection, your focus changes, but then it refocuses the text box after your selection populates.
The fiddle didn't do it for some reason though. But i came up with this and it seems to fix it ok. Only binds if it's empty, and it does it on change still, so seems to work in all circumstances.
- $("#txtNewFromStoreNo").autocomplete({
- source: availableTags, minLength: 0
- }).bind('focus', function () {
- if(!$(this).val().trim())
- $(this).keydown();
- });