woocommerce / selectWoo

selectWoo is a fork of select2 with improved accessibility.
MIT License
124 stars 27 forks source link

jQuery object not supported as templateSelection - Displays as [object Object] #31

Open uturnr opened 5 years ago

uturnr commented 5 years ago

The current version of select2 supports jQuery objects in both templateResult and templateSelection. The current version of selectWoo only supports them for templateResult.

This is how my selected template appears when I use a jQuery object in selectWoo:

Screen Shot 2019-08-26 at 12 22 11 PM

SingleSelection.prototype.update is different in the current version of select2, and in particular, changing:

$rendered.empty().text(formatted);

to:

$rendered.empty().append(formatted);

would add support for jQuery objects.

fabianmarz commented 4 years ago

Please see my comment in #39.