jquery.val setter patch for chosen #1027

RobinHerbots opened this Issue Feb 8, 2013 · 3 comments


None yet

3 participants



I wrote a little patch which fixes the issue that when setting the value with jquery.val you always have to trigger to get the change. Maybe you can include it in the cosen codebase

best regards,


    valHooks: {
        select: {
            _set: $.valHooks.select.set,
            set: function (elem, value) {
                var values = jQuery.valHooks.select._set.call(this, elem, value);

                if ($(elem).hasClass("chosen")) {
                    setTimeout(function () {
                    }, 0);

                return values;

I don't think we should patch jQuery in Chosen.

Thus, your solution may have a huge impact on performances as I think Chosen uses the setter itself


Thanks for sharing, @RobinHerbots. I agree with @stof that this should not be a part of Chosen by default. Hopefully anyone else searching for this kind of solution will find this issue and be able to implement with your code, though!

@pfiller pfiller closed this Apr 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment