Skip to content

Bug: Select-All, filter down via search, and then either selecting all again or selecting an option will leave the array still filled with previous options #474

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

Closed
sharpk1 opened this issue Sep 7, 2021 · 2 comments

Comments

@sharpk1
Copy link

sharpk1 commented Sep 7, 2021

First of all, thank you so much for taking the time, effort, and energy to write such a dynamic component!

I do have this lingering bug I have been trying to work through on my project.

The setup: My MultiSelect component is created in such a way that it will render with all options selected. If all options are selected, all of the options on my schema table will be rendered. If nothing is selected, no options on my schema table will be rendered.

The Expected Behavior: Whenever I search for an option, I thought de-selecting the Select-All option would remove everything in the array and then I would be able to select my option that would be filtered down

The Actual Behavior: Whenever I search for an option, I select the Select-All option to de-select whichever options are shown and select the option I filtered via the search. The array still contains the previous options from the first Select-All upon first render.

Shouldn't the Select-All be a true select all and be able to either clear out or fill the array with all or nothing? If you can point me in the right direction as far as configuring or maybe even making a PR for the fix. That would stellar.

Cheers!

I have this video to better demonstrate too:

20210907_113850.mp4
@harshzalavadiya
Copy link
Member

@sharpk1 thanks for reporting this, actully it was supposed to always filter shown option so if it;s filtered it should always apply to filtered options

because if you want to clear all values you can use cross (x) next to dropdown caret icon

I have made two changes in order to fix this

  • "select all" will always work for filterd values if there's filter value
  • to make this explicitly clear I have added another key that will be shown for filtered keys

Peek 2021-09-08 13-40

@harshzalavadiya
Copy link
Member

released v4.1.10

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