1
0
mirror of synced 2025-02-17 04:23:15 +03:00

Merge pull request #979 from mynameistechno/master

Fixes #291
This commit is contained in:
Igor Vaynberg 2013-04-10 12:30:05 -07:00
commit f582d8ae15

View File

@ -2332,13 +2332,14 @@ the specific language governing permissions and limitations under the Apache Lic
// multi
clearSearch: function () {
var placeholder = this.getPlaceholder();
var placeholder = this.getPlaceholder(),
maxWidth = this.getMaxSearchWidth();
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
// we could call this.resizeSearch(), but we do not because that requires a sizer and we do not want to create one so early because of a firefox bug, see #944
this.search.width(this.getMaxSearchWidth());
this.search.width(maxWidth > 0 ? maxWidth : this.container.css("width"));
} else {
this.search.val("").width(10);
}