ソースを参照

Only select the first suitable item if nothing is already selected

Brendan Heywood 12 年 前
コミット
6c59b1e99c
1 ファイル変更1 行追加1 行削除
  1. 1 1
      select2.js

+ 1 - 1
select2.js

@@ -2166,7 +2166,7 @@ the specific language governing permissions and limitations under the Apache Lic
                 }
                 }
             });
             });
 
 
-            if (this.opts.closeOnSelect){
+            if (this.highlight() == -1){
                 choices.each2(function (i, choice) {
                 choices.each2(function (i, choice) {
                     if (!choice.hasClass("select2-disabled") && choice.hasClass("select2-result-selectable")) {
                     if (!choice.hasClass("select2-disabled") && choice.hasClass("select2-result-selectable")) {
                         self.highlight(0);
                         self.highlight(0);