From a4d496281a77aecd11b42c087838e494dd4d5522 Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Fri, 6 Jul 2012 23:30:39 +0300 Subject: [PATCH] fix input sizing when placeholder is set. fixes #192 --- select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2.js b/select2.js index 4df18c80..2f48d625 100755 --- a/select2.js +++ b/select2.js @@ -1550,7 +1550,7 @@ if (placeholder !== undefined && this.getVal().length === 0 && this.search.hasClass("select2-focused") === false) { this.search.val(placeholder).addClass("select2-default"); // stretch the search box to full width of the container so as much of the placeholder is visible as possible - this.search.width(this.getContainerWidth()); + this.search.width(this.container.width()); } else { // we set this to " " instead of "" and later clear it on focus() because there is a firefox bug // that does not properly render the caret when the field starts out blank