Skip to content

Commit c4c1cba

Browse files
author
Kevin Brown
committed
Fixed placeholder detection. Fixes select2#424.
1 parent 6351f25 commit c4c1cba

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

select2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,7 +1587,7 @@
15871587
// single
15881588
initSelection: function () {
15891589
var selected;
1590-
if (this.opts.element.val() === "") {
1590+
if (this.opts.element.val() === "" && this.opts.element.text() === "") {
15911591
this.close();
15921592
this.setPlaceholder();
15931593
} else {
@@ -1921,7 +1921,7 @@
19211921
// multi
19221922
initSelection: function () {
19231923
var data;
1924-
if (this.opts.element.val() === "") {
1924+
if (this.opts.element.val() === "" && this.opts.element.text() === "") {
19251925
this.updateSelection([]);
19261926
this.close();
19271927
// set the placeholder if necessary

0 commit comments

Comments
 (0)