From e3751422f032dcba4273c85e3ccbfead2b1b703d Mon Sep 17 00:00:00 2001 From: Dawn Hammond Date: Mon, 28 Apr 2014 14:15:50 -0500 Subject: [PATCH 1/2] Fix focus issue when select-input has placeholder --- select2.js | 1 + 1 file changed, 1 insertion(+) diff --git a/select2.js b/select2.js index 5525b1ea..8ff01902 100644 --- a/select2.js +++ b/select2.js @@ -2637,6 +2637,7 @@ the specific language governing permissions and limitations under the Apache Lic .attr('for', this.search.attr('id')); this.search.on("input paste", this.bind(function() { + if (this.search.attr('placeholder') && !this.search.val()) return; if (!this.isInterfaceEnabled()) return; if (!this.opened()) { this.open(); From 796661a11ddf6bef4d9ebbb776a07ea4065f000f Mon Sep 17 00:00:00 2001 From: Dawn Hammond Date: Mon, 28 Apr 2014 16:49:08 -0500 Subject: [PATCH 2/2] change condition to use length --- select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2.js b/select2.js index 8ff01902..b709d060 100644 --- a/select2.js +++ b/select2.js @@ -2637,7 +2637,7 @@ the specific language governing permissions and limitations under the Apache Lic .attr('for', this.search.attr('id')); this.search.on("input paste", this.bind(function() { - if (this.search.attr('placeholder') && !this.search.val()) return; + if (this.search.attr('placeholder') && this.search.val().length == 0) return; if (!this.isInterfaceEnabled()) return; if (!this.opened()) { this.open();