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

Not possible to add another filter in the popup #157

Open
eriktelepovsky opened this issue Dec 21, 2021 · 1 comment
Open

Not possible to add another filter in the popup #157

eriktelepovsky opened this issue Dec 21, 2021 · 1 comment

Comments

@eriktelepovsky
Copy link

eriktelepovsky commented Dec 21, 2021

Describe the bug
Not possible to add another filter field in the popup.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'model admin'
  2. Click on 'Advanced filter'
  3. Click on 'Add another filter'
  4. See error in the Javascript Console

Expected behavior
No error in the console and new field added.

Screenshots
image

Details (please complete the following information):

  • OS: [doesn't matter, but tried both Mac and Debian]
  • Python version [3.9.8]
  • Django version [3.1.2]
  • django-advanced-filters version [1.3.0]
  • Browser [Chrome 96.0.4664.110, Safari 14.1.2]
  • I don't use Grappelli

Additional context
JavaScript Console:
image

Possible fix
It works when I comment line 142 in advanced-filters.js:

$('.form-row input.query-value').each(function() {
    // $(this).select2("destroy");
});
@asfaltboy
Copy link
Member

That's odd, haven't touched this code for a while... are you configuring your own version of select2 library in settings.SELECT2_JS? If so, could you check which version you're using?

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

2 participants