From 5cf5deb2676e66fc5fc34dfc0b4f3a39ff39468d Mon Sep 17 00:00:00 2001 From: pmirshad Date: Wed, 5 Sep 2012 01:50:34 +0530 Subject: [PATCH 1/2] Fix placeholder missing on tab out on input tags Tabbing out of input tags with multiple set as true and no value selected will result in the default placeholder not being shown. This patch fixes the issue by calling clearSearch() on blur of MultiSelect2 and preventing the bubbling of the blur event to the abstract class. Test case with version 3.2: http://jsfiddle.net/pmirshad/PqP2L/1/ --- select2.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/select2.js b/select2.js index 6d6eddfe..b3ee30fd 100755 --- a/select2.js +++ b/select2.js @@ -1867,6 +1867,9 @@ this.search.bind("blur", this.bind(function() { this.container.removeClass("select2-container-active"); + this.search.removeClass("select2-focused"); + this.clearSearch(); + e.stopImmediatePropagation(); })); this.container.delegate(selector, "mousedown", this.bind(function (e) { From 9fe24530794a0855c99fec028f4b417278c8537c Mon Sep 17 00:00:00 2001 From: pmirshad Date: Wed, 5 Sep 2012 01:52:55 +0530 Subject: [PATCH 2/2] Adding event argument to the bound function --- select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2.js b/select2.js index b3ee30fd..13b55a4e 100755 --- a/select2.js +++ b/select2.js @@ -1865,7 +1865,7 @@ this.search.bind("keyup", this.bind(this.resizeSearch)); - this.search.bind("blur", this.bind(function() { + this.search.bind("blur", this.bind(function(e) { this.container.removeClass("select2-container-active"); this.search.removeClass("select2-focused"); this.clearSearch();