Browse Source

Focus the search upon opening

Kevin Brown 10 năm trước cách đây
mục cha
commit
5535f072e1

+ 2 - 0
dist/js/select2.amd.full.js

@@ -1510,6 +1510,8 @@ define('select2/dropdown/search',[
 
     container.on('open', function () {
       self.$search.attr('tabindex', 0);
+
+      self.$search.focus();
     });
 
     container.on('close', function () {

+ 2 - 0
dist/js/select2.amd.js

@@ -1510,6 +1510,8 @@ define('select2/dropdown/search',[
 
     container.on('open', function () {
       self.$search.attr('tabindex', 0);
+
+      self.$search.focus();
     });
 
     container.on('close', function () {

+ 2 - 0
dist/js/select2.full.js

@@ -11045,6 +11045,8 @@ define('select2/dropdown/search',[
 
     container.on('open', function () {
       self.$search.attr('tabindex', 0);
+
+      self.$search.focus();
     });
 
     container.on('close', function () {

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/js/select2.full.min.js


+ 2 - 0
dist/js/select2.js

@@ -1938,6 +1938,8 @@ define('select2/dropdown/search',[
 
     container.on('open', function () {
       self.$search.attr('tabindex', 0);
+
+      self.$search.focus();
     });
 
     container.on('close', function () {

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/js/select2.min.js


+ 2 - 0
src/js/select2/dropdown/search.js

@@ -37,6 +37,8 @@ define([
 
     container.on('open', function () {
       self.$search.attr('tabindex', 0);
+
+      self.$search.focus();
     });
 
     container.on('close', function () {

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác