Skip to content

Commit 2f5eade

Browse files
committed
Autocomplete: changed autoFocus default to true for 1.9. Fixed #7042 - Autocomplete: Default autoFocus to true
1 parent 09215ef commit 2f5eade

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

tests/unit/autocomplete/autocomplete_core.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ test( "prevent form submit on enter when menu is active", function() {
6060
test( "allow form submit on enter when menu is not active", function() {
6161
var event;
6262
var ac = $( "#autocomplete" ).autocomplete({
63+
autoFocus: false,
6364
source: [ "java", "javascript" ]
6465
}).val( "ja" ).autocomplete( "search" );
6566

tests/unit/autocomplete/autocomplete_defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
var autocomplete_defaults = {
66
appendTo: "body",
7-
autoFocus: false,
7+
autoFocus: true,
88
delay: 300,
99
disabled: false,
1010
minLength: 1,

tests/unit/autocomplete/autocomplete_events.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ var data = ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "py
1414
test("all events", function() {
1515
expect(12);
1616
var ac = $("#autocomplete").autocomplete({
17+
autoFocus: false,
1718
delay: 0,
1819
source: data,
1920
search: function(event) {
@@ -56,6 +57,7 @@ test("all events", function() {
5657
test("all events - contenteditable", function() {
5758
expect(12);
5859
var ac = $("#autocomplete-contenteditable").autocomplete({
60+
autoFocus: false,
5961
delay: 0,
6062
source: data,
6163
search: function(event) {

ui/jquery.ui.autocomplete.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ $.widget( "ui.autocomplete", {
2222
defaultElement: "<input>",
2323
options: {
2424
appendTo: "body",
25-
autoFocus: false,
25+
autoFocus: true,
2626
delay: 300,
2727
minLength: 1,
2828
position: {

0 commit comments

Comments
 (0)