Having trouble working with SelectWoo instances of Select2 within WooCommerce : <p>I am using Select2 within WooCommerce in some of my own custom areas and I am targeting it with some code to add and removes certain classes and it's working fine; however the <a href="https://github.com/woocommerce/selectWoo" rel="noreferrer">SelectWoo</a> instances used by WooCommerce themselves are not working.</p>

<p>Example code:</p>

<pre><code>(function($) {

    $('select').each(function(e) {
        handleSelectSelections($(this));
    });


})( jQuery );

function handleSelectSelections(select) {

    var el = (select.next('.select2').length) ? jQuery(select.data('select2').$container) : select;

    if (select.val() !== "" &amp;&amp; select.val() !== null) {
        el.addClass('has-selection');
    } else {
        el.removeClass('has-selection');
    }

}
</code></pre>

<p>Everything works fine, except when it gets to the actual part where it adds the class it doesn't work - no class is added.</p>

<p>Am I missing something here?</p>
