mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04: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
056cab82d8
commit
09215ef2cd
@ -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
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user