From bca6a503310a5e0c8b8030c63ff66ab52cd7885c Mon Sep 17 00:00:00 2001 From: Tore Olav Kristiansen Date: Fri, 27 Oct 2017 16:16:08 +0200 Subject: [PATCH] Fixed unit test issue and typo in Norwegian translation --- src/js/select2/i18n/nb.js | 4 +--- src/js/select2/selection/search.js | 8 +++++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/js/select2/i18n/nb.js b/src/js/select2/i18n/nb.js index d42fb7dc..e005dcea 100644 --- a/src/js/select2/i18n/nb.js +++ b/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…'; diff --git a/src/js/select2/selection/search.js b/src/js/select2/selection/search.js index 7c941faf..3ff96f94 100644 --- a/src/js/select2/selection/search.js +++ b/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(); + } } };