From 779df6517d4e1bdd7ed3667537adb67c7443d15f Mon Sep 17 00:00:00 2001 From: Richard Worth Date: Tue, 15 Mar 2011 05:43:19 -0400 Subject: Autocomplete: new option autoFocus, default false. Fixed #7032 - Autocomplete: Add option to automatically highlight the first result --- ui/jquery.ui.autocomplete.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ui/jquery.ui.autocomplete.js') diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index a497b72fd..204322320 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -20,6 +20,7 @@ var requestIndex = 0; $.widget( "ui.autocomplete", { options: { appendTo: "body", + autoFocus: false, delay: 300, minLength: 1, position: { @@ -359,6 +360,10 @@ $.widget( "ui.autocomplete", { this.menu.deactivate(); this.menu.refresh(); + if ( this.options.autoFocus ) { + this.menu.next( new $.Event("mouseover") ); + } + // size and position menu ul.show(); this._resizeMenu(); -- cgit v1.2.3