Skip to content

Commit

Permalink
Fixed placeholder detection. Fixes select2#424.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Brown committed Sep 24, 2012
1 parent 6351f25 commit c4c1cba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions select2.js
Original file line number Diff line number Diff line change
Expand Up @@ -1587,7 +1587,7 @@
// single
initSelection: function () {
var selected;
if (this.opts.element.val() === "") {
if (this.opts.element.val() === "" && this.opts.element.text() === "") {
this.close();
this.setPlaceholder();
} else {
Expand Down Expand Up @@ -1921,7 +1921,7 @@
// multi
initSelection: function () {
var data;
if (this.opts.element.val() === "") {
if (this.opts.element.val() === "" && this.opts.element.text() === "") {
this.updateSelection([]);
this.close();
// set the placeholder if necessary
Expand Down

0 comments on commit c4c1cba

Please sign in to comment.