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

"Per page" selector change breaks filters with multiple values #5429

Open
francois-ferrandis opened this Issue Jun 16, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@francois-ferrandis
Contributor

francois-ferrandis commented Jun 16, 2018

Expected behavior

On such an index view :

filter :tags, multiple: true
config.per_page = [30, 200, 5000]
  1. Select multiple values in the :tags filter and click "Filter" button
  2. Change the per_page parameter at the bottom of the index table from 30 to 200
  3. Selected values in filter should not change

Actual behavior

  1. Filter contains only one selected value

More info

This is due to the way the queryStringToParams method is implemented :

As you can see, this method does not support querystrings containing arrays.

The toQueryString method seems to exhibit the same flaws:

I am not aware of your policy on using JS libraries (I understand you want to keep it light), but this one seems quite appropriate for this job: https://github.com/ljharb/qs

I tried to look into the issue myself but did not find info on how JS libraries are packaged in this project. I would love some help on how to contribute using the qs library.

Thank you very much for your time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment