Skip to content

Commit c1df0aa

Browse files
committed
Merge pull request select2#2702 from dgroux/master
allow formatSelection to return a jQuery object
2 parents 08ee57a + d385dc5 commit c1df0aa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

select2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3058,7 +3058,7 @@ the specific language governing permissions and limitations under the Apache Lic
30583058

30593059
formatted=this.opts.formatSelection(data, choice.find("div"), this.opts.escapeMarkup);
30603060
if (formatted != undefined) {
3061-
choice.find("div").replaceWith("<div>"+formatted+"</div>");
3061+
choice.find("div").replaceWith($("<div></div>").html(formatted));
30623062
}
30633063
cssClass=this.opts.formatSelectionCssClass(data, choice.find("div"));
30643064
if (cssClass != undefined) {

0 commit comments

Comments
 (0)