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

chosen-selectpicker + unique-filter = javascript error #950

Open
jakeb16 opened this issue May 21, 2022 · 2 comments
Open

chosen-selectpicker + unique-filter = javascript error #950

jakeb16 opened this issue May 21, 2022 · 2 comments

Comments

@jakeb16
Copy link

jakeb16 commented May 21, 2022

I started using QueryBuilder as a starting point for a custom control I am working on.
It's working great and I have been able to do most of what I hoped, however I justed noticed a problem with using
chosen-selectpicker + unique-filter

I created a little demo (based on someone elses demo) to illustrate the problem.
https://codepen.io/jakeb16/pen/bGLRjPQ

If you click "add a rule:" then change the first rule Name to Category (you shouldn’t even be able to do this since category is marked as unique)
You get the JavaScript error (Uncaught UndefinedFilterError: Undefined filter "null")

If you remove the chosen-selectpicker plugin it works fine.

I'll look and see if I can figure out what's causing this but thought I would post to see if anyone else has an idea.

@jakeb16
Copy link
Author

jakeb16 commented May 23, 2022

I had the wrong code pin linked its here
https://codepen.io/jakeb16/pen/bGLRjPQ

@jakeb16
Copy link
Author

jakeb16 commented May 23, 2022

Updating applyDisabledfilters with this at the end seems to fix the issue
`// update Selectpicker

    else if (self.settings.plugins && self.settings.plugins['chosen-selectpicker']) {
        self.$el.find(QueryBuilder.selectors.rule_filter).trigger('chosen:updated');
    }`

I'll see about how to propose a change, I have never really done that before on git

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

No branches or pull requests

1 participant