danielfarrell / bootstrap-combobox

A combobox plugin that works with twitter bootstrap
847 stars 327 forks source link

Remove glyphicon not shown when using with jQuery 3.5.1 #271

Open daniel-rutten-clickwise-limited opened 4 years ago

daniel-rutten-clickwise-limited commented 4 years ago

I've just upgraded form jQuery 3.4.1 to 3.5.1 and the glyphicon-remove is no longer shown when I select from the drop down box. I think the problem is due to the way the template is defined (see the template function on line 181).

It looks like 3.4.1 used to translate

<span class="caret" /><span class="glyphicon glyphicon-remove" />

to

<span class="caret"></span><span class="glyphicon glyphicon-remove"></span>

but 3.5.1 turns that into

<span class="caret"><span class="glyphicon glyphicon-remove"></span></span>

Since the caret class is hidden when I select from the drop down box, the remove icon is hidden as wel.

I've fixed it for now by changing

<span class="caret" /><span class="glyphicon glyphicon-remove" />

into

<span class="caret"></span><span class="glyphicon glyphicon-remove"></span>

but I was wondering if anyone else has found this problem.

tiesont commented 4 years ago

Yeah, spans are not self-closing, so that's not really valid. I'll see if I can fix that sometime today or this weekend.

tiesont commented 4 years ago

Related: https://jquery.com/upgrade-guide/3.5/#jquery-htmlprefilter-changes

eeintech commented 4 years ago

Thanks for that solution @danielrutten, works for me!