laktek / jQuery-Smart-Auto-Complete

AutoComplete plugin with smart defaults and flexibility to customize
http://laktek.com/2011/03/03/introducing-jquery-smart-autocomplete/
248 stars 34 forks source link

Escape Key Support #1

Closed X4 closed 8 years ago

X4 commented 13 years ago

I think supporting the loosing of the list-focus through a hit of a button would be nice to have.

stryju commented 13 years ago

quick fix for that is to add esc key support in this.each loop:

add this around line 429:

        else if (ev.keyCode == '27'){
                    $(options.context).trigger('itemSelect');
                    return false;
        }

keep in mind this will trigger itemSelect event!