Skip to content

SelectMultiple: Clear All does not work with reduce: true in valueKey #6515

@TimPchelintsev

Description

@TimPchelintsev

Expected Behavior

"Clear All" button should appear instead of "Select All" in SelectMultiple component after "Select All" was applied with "reduce: true" option set for "valueKey"

Actual Behavior

Component was stuck in "Select All" mode even with all options already selected

URL, screen shot, or Codepen exhibiting the issue

https://codesandbox.io/s/grommet-v2-template-forked-l8b45k?file=/index.js

Steps to Reproduce

  1. Set "reduce: true" for "valueKey" with object options in SelectMultiple component
  2. Click "Select All" button - it works as expected
  3. BUT button will not change to "Clear All" - bug

Your Environment

  • Grommet version: 2.28.0
  • Browser Name and version: Google Chrome 107.0.5304.110
  • Operating System and version (desktop or mobile): Mac OS Ventura 13.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugissue that does not match design or documentation and requires code changes to address

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions