mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Autocomplete: new option autoFocus, default false. Fixed #7032 - Autocomplete: Add option to automatically highlight the first result
This commit is contained in:
parent
69ebdf46a5
commit
779df6517d
@ -4,6 +4,7 @@
|
||||
|
||||
var autocomplete_defaults = {
|
||||
appendTo: "body",
|
||||
autoFocus: false,
|
||||
delay: 300,
|
||||
disabled: false,
|
||||
minLength: 1,
|
||||
|
5
ui/jquery.ui.autocomplete.js
vendored
5
ui/jquery.ui.autocomplete.js
vendored
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user