瀏覽代碼

Fixed unit test issue and typo in Norwegian translation

Tore Olav Kristiansen 7 年之前
父節點
當前提交
bca6a50331
共有 2 個文件被更改,包括 8 次插入4 次删除
  1. 1 3
      src/js/select2/i18n/nb.js
  2. 7 1
      src/js/select2/selection/search.js

+ 1 - 3
src/js/select2/i18n/nb.js

@@ -12,9 +12,7 @@ define(function () {
     inputTooShort: function (args) {
       var remainingChars = args.minimum - args.input.length;
 
-      var message = 'Vennligst skriv inn ' + remainingChars + ' tegn til';
-
-      return message + ' tegn til';
+      return 'Vennligst skriv inn ' + remainingChars + ' tegn til';
     },
     loadingMore: function () {
       return 'Laster flere resultater…';

+ 7 - 1
src/js/select2/selection/search.js

@@ -175,7 +175,13 @@ define([
 
     this.resizeSearch();
     if (searchHadFocus) {
-      this.$element.focus();
+      var isTagInput = this.$element.find('[data-select2-tag]').length;
+      if (isTagInput) {
+        // fix IE11 bug where tag input lost focus
+        this.$element.focus();
+      } else {
+        this.$search.focus();
+      }
     }
   };