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

Incorrect amount of selected values in checkbox filter when values don't match options #207

Open
LeopoldArkham opened this issue Mar 1, 2022 · 0 comments

Comments

@LeopoldArkham
Copy link
Collaborator

LeopoldArkham commented Mar 1, 2022

Screenshot 2022-03-01 at 14 45 57

Here the amount of selected values reported by the component doesn't match the amount of checked checkboxes because the `values` prop contains a value that has no match in the `options`

E.g.:

<CheckboxFilter
  values={[0, 1, 3]} // No value '3' in the options but the component will report three values selected
  options={[
    {label: '...', value: 0},
    {label: '...', value: 1},
    {label: '...', value: 2},
  ]}
/>

Additionally the component might issue a warning when values don't match the options.

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