Skip to content

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

@LeopoldArkham

Description

@LeopoldArkham

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions