Skip to content
Permalink
Browse files

Autocomplete: new option autoFocus, default false. Fixed #7032 - Auto…

…complete: Add option to automatically highlight the first result
  • Loading branch information
rdworth committed Mar 15, 2011
1 parent 056cab8 commit 09215ef2cda488cafa92c42a8c63e2f1131147d0
Showing with 6 additions and 0 deletions.
  1. +1 −0 tests/unit/autocomplete/autocomplete_defaults.js
  2. +5 −0 ui/jquery.ui.autocomplete.js
@@ -4,6 +4,7 @@

var autocomplete_defaults = {
appendTo: "body",
autoFocus: false,
delay: 300,
disabled: false,
minLength: 1,
@@ -22,6 +22,7 @@ $.widget( "ui.autocomplete", {
defaultElement: "<input>",
options: {
appendTo: "body",
autoFocus: false,
delay: 300,
minLength: 1,
position: {
@@ -362,6 +363,10 @@ $.widget( "ui.autocomplete", {
this.menu.blur();
this.menu.refresh();

if ( this.options.autoFocus ) {
this.menu.next( new $.Event("mouseover") );
}

// size and position menu
ul.show();
this._resizeMenu();

0 comments on commit 09215ef

Please sign in to comment.
You can’t perform that action at this time.