Menu

#4 Key => Value feature & Bug Fix

open
nobody
None
5
2006-05-02
2006-05-02
Anonymous
No

This is a specific version not meant to be a patch, but
I'd thought I'd post it anyway in case other people are
in the same situation I'm in.

This version adds support for key => value items. To
use, create an array called 'key_collection' that
contains keys, and have this correspond to the
'collection' array of values. This script only works
for key => values pairs now, it is not backward
compatible with just a value array. Also, the script
will automatically go to the location (window.location)
specified in the key. For example, a key might be set
to 'index.php?dosomething=value'. Don't use the patch
if you don't want the autocomplete to reload the page
everytime the user selected something from the list.

Also, I fixed a bug where, if the user was typing in
text and the mouse was positioned somewhere over the
result element, the element under the mouse would
automatically be selected. This is annoying as most of
the time you don't want it to do this. I got around
this by saving the position of the mouse in the last
event called, and seeing if the mouse cursor had moved
since the time the key had been pressed; if it hadn't
moved (user isn't utilizing the mouse), then don't
select the element the mouse is over.

Discussion


Log in to post a comment.