We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c098f51 commit bdd7468Copy full SHA for bdd7468
1 file changed
select2.js
@@ -2059,8 +2059,10 @@
2059
val = this.getVal(),
2060
formatted;
2061
2062
- formatted=this.opts.formatSelection(data, choice);
2063
- choice.find("div").replaceWith("<div>"+this.opts.escapeMarkup(formatted)+"</div>");
+ formatted=this.opts.formatSelection(data, choice.find("div"));
+ if (formatted != undefined) {
2064
+ choice.find("div").replaceWith("<div>"+this.opts.escapeMarkup(formatted)+"</div>");
2065
+ }
2066
choice.find(".select2-search-choice-close")
2067
.bind("mousedown", killEvent)
2068
.bind("click dblclick", this.bind(function (e) {
0 commit comments