Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deselect/select doesn't work with search when value is typed in search #711

Closed
Abhilash3 opened this issue Feb 29, 2016 · 2 comments
Closed
Labels

Comments

@Abhilash3
Copy link

Hello,

    select.multiselect('deselect', 'foo');

fails when we have search enabled and searched 'foo', relevant code:

    getInputByValue: function (value) {

        var checkboxes = $('li input', this.$ul);
        var valueToCompare = value.toString();

        for (var i = 0; i < checkboxes.length; i = i + 1) {
            var checkbox = checkboxes[i];
            if (checkbox.value === valueToCompare) {
                return $(checkbox);
            }
        }
    },

This method, gets the first checkbox (actually first input, even search), and when an option's value is equal to the text written in search then the above method returns the search box instead of the actual checkbox.

Thank you.

@davidstutz
Copy link
Owner

I will check this, this should not happen, Thanks for reporting.

@Abhilash3
Copy link
Author

Probable fix:
var checkboxes = $('li input:not(.filter)', this.$ul);
tested it on my environment, seems to be working :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants