1
0
mirror of synced 2024-11-25 22:36:03 +03:00

fix input sizing when placeholder is set. fixes #192

This commit is contained in:
Igor Vaynberg 2012-07-06 23:30:39 +03:00
parent 77de06ecf3
commit a4d496281a

View File

@ -1550,7 +1550,7 @@
if (placeholder !== undefined && this.getVal().length === 0 && this.search.hasClass("select2-focused") === false) { if (placeholder !== undefined && this.getVal().length === 0 && this.search.hasClass("select2-focused") === false) {
this.search.val(placeholder).addClass("select2-default"); 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 // 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 { } else {
// we set this to " " instead of "" and later clear it on focus() because there is a firefox bug // 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 // that does not properly render the caret when the field starts out blank