Hi!
This patch chages bahaviour when using Tab and Enter to be more consistent with plugin role.
Why:
Warning: it is not easy to understand what is wrong, so be ready for some brain work :)
After using this plugin for some time on production website I realised that there is something wrong with it. Fixing it without changing source code went impossible.
Whats wrong:
It is impossible to enter short values to the input field USING Tab and Enter keys IF there are longer results in suggestions area AND if mouse pointer is over those results (accidentely it is always there).
This is because active suggestion is changed by mouseover event.
How it should work:
It should be possible to enter any value and finish entering it with Tab or Enter without modification and without generating select action on plugin, wherever mouse pointer is. More strictly - suggestion selection using Tab and Enter should fire only when suggestion was chosen by UP and Down keys, not by mouse.
How to reproduce:
Open demo jQuery-Autocomplete/index.htm from the source (can't find it online)
Click to the second example (first uses Hint and should work as it is) under "Type NHL or NBA team name:" input field
move mouse pointer down a bit, to the "Container" word
Try to enter letter "a" and push Tab, this will result to 'Atlanta Thrashers'' selection.
As you can see, without moving mouse pointer outside of suggestion area it is impossible to enter "a" symbol to this field
Go to google.com and try the same with their suggestion field - google behaves corectly
Hi! This patch chages bahaviour when using Tab and Enter to be more consistent with plugin role.
Why: Warning: it is not easy to understand what is wrong, so be ready for some brain work :)
After using this plugin for some time on production website I realised that there is something wrong with it. Fixing it without changing source code went impossible.
Whats wrong:
This is because active suggestion is changed by mouseover event.
How it should work:
It should be possible to enter any value and finish entering it with Tab or Enter without modification and without generating select action on plugin, wherever mouse pointer is. More strictly - suggestion selection using Tab and Enter should fire only when suggestion was chosen by UP and Down keys, not by mouse.
How to reproduce:
Patch
Patch provided.