Skip to content

Commit d385dc5

Browse files
Dylan RouxDylan Roux
authored andcommitted
allow formatSelection to return a jQuery object
1 parent c5c42ea commit d385dc5

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
@@ -3052,7 +3052,7 @@ the specific language governing permissions and limitations under the Apache Lic
30523052

30533053
formatted=this.opts.formatSelection(data, choice.find("div"), this.opts.escapeMarkup);
30543054
if (formatted != undefined) {
3055-
choice.find("div").replaceWith("<div>"+formatted+"</div>");
3055+
choice.find("div").replaceWith($("<div></div>").html(formatted));
30563056
}
30573057
cssClass=this.opts.formatSelectionCssClass(data, choice.find("div"));
30583058
if (cssClass != undefined) {

0 commit comments

Comments
 (0)