From dd6198a3faaa52172577bc917bcd62a8d54eddd7 Mon Sep 17 00:00:00 2001 From: Fabrice Daugan Date: Wed, 2 Apr 2014 14:03:01 +0200 Subject: [PATCH] Ignore focus and error on IE7 for disabled select2 For disabled components, focus event was triggered. On modern browser this error was ignored but not on IE7. This PR save weird focus event and IE7 JS error. --- select2.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/select2.js b/select2.js index 3beb6420..ae5fa469 100644 --- a/select2.js +++ b/select2.js @@ -2583,8 +2583,7 @@ the specific language governing permissions and limitations under the Apache Lic this.selection = selection = this.container.find(selector); var _this = this; - this.selection.on("click", ".select2-search-choice:not(.select2-locked)", function (e) { - //killEvent(e); + this.selection.on("click", ".select2-container:not(.select2-container-disabled) .select2-search-choice:not(.select2-locked)", function (e) { _this.search[0].focus(); _this.selectChoice($(this)); });