Skip to content

Commit 0c11ed7

Browse files
committed
Merge pull request select2#444 from kevin-brown/master
Fixes 424: Improved Placeholder Detection
2 parents 6351f25 + c4c1cba commit 0c11ed7

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)