aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.autocomplete.js
diff options
context:
space:
mode:
authorRichard Worth <rdworth@gmail.com>2011-03-15 05:39:56 -0400
committerRichard Worth <rdworth@gmail.com>2011-03-15 05:39:56 -0400
commit09215ef2cda488cafa92c42a8c63e2f1131147d0 (patch)
tree6c7122719bbe929d8946537b93e2762884f81983 /ui/jquery.ui.autocomplete.js
parent056cab82d8b710953f79cc833b468cb1a24cba9c (diff)
downloadjquery-ui-09215ef2cda488cafa92c42a8c63e2f1131147d0.tar.gz
jquery-ui-09215ef2cda488cafa92c42a8c63e2f1131147d0.zip
Autocomplete: new option autoFocus, default false. Fixed #7032 - Autocomplete: Add option to automatically highlight the first result
Diffstat (limited to 'ui/jquery.ui.autocomplete.js')
-rw-r--r--ui/jquery.ui.autocomplete.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js
index c83f042c0..e6acd4b63 100644
--- a/ui/jquery.ui.autocomplete.js
+++ b/ui/jquery.ui.autocomplete.js
@@ -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();