a small tweak to empty string handling in select2.val(). issue #34
This commit is contained in:
parent
09d7a2de6e
commit
d0caa9131c
@ -1017,8 +1017,8 @@
|
|||||||
});
|
});
|
||||||
this.updateSelection(data);
|
this.updateSelection(data);
|
||||||
} else {
|
} else {
|
||||||
// val is an object
|
// val is an object. !val is true for [undefined,null,'']
|
||||||
this.opts.element.val((val === null || val === "") ? "" : val.id);
|
this.opts.element.val(!val ? "" : val.id);
|
||||||
this.updateSelection(val);
|
this.updateSelection(val);
|
||||||
}
|
}
|
||||||
this.setPlaceholder();
|
this.setPlaceholder();
|
||||||
|
Loading…
Reference in New Issue
Block a user