views:

159

answers:

2

See: http://www.airbnb.com/

In the search bar, start typing "san f" (no quotes, all lowercase), then hit Return (or Enter). "San Francisco" is autocompleted. This is good!

Now clear the search field and start over. type "San F" and boom - "San Francisco" is autocompleted as soon as you hit Shift. This is not expected.

This happens in FF & Safari, but is untested elsewhere. I've looked through the jQuery Autocomplete Source Code and everything looks normal.

Has anyone experienced this before?

A: 

To get around this issue:

To the KEY object add:

    SHIFT: 16,
    CTRL: 17,
    ALT: 18

And to the very top of the onChange function add:

if ( jQuery.inArray(lastKeyPressCode, [KEY.SHIFT, KEY.CTRL,
       KEY.ALT]) !== -1 )
                return; 
Glennular
+1  A: 

I think in the autocomple configuration autoFill: true is defined. Remove this one it will solve the problem.But in that case after writing of the "san f" it will not automaticaly fill the "san Francisco, CA".

Suvonkar