carbon-design-system / carbon

A design system built by IBM
https://www.carbondesignsystem.com
Apache License 2.0
7.86k stars 1.82k forks source link

Multiselect.Filterable not showing initiallySelectedItems #7047

Closed brittanykvanvig closed 3 years ago

brittanykvanvig commented 4 years ago

What package(s) are you using?

Detailed description

Describe in detail the issue you're having.

We are passing in initialSelectedItems to the component, and it doesn't always select the items correctly. The first time passing values works. The second time nothing is preselected (screenshots below). The third time, occasionally will show the 2nd option preselected, other times nothing is preselected like the second time.

Is this issue related to a specific component?

Yes - MultiSelect.Filterable

What did you expect to happen? What happened instead? What would you like to see changed?

Expected when passing initialSelectedItems, those items are selected in the component.

What browser are you working in?

Chrome

What version of the Carbon Design System are you using?

7.16.0

What offering/product do you work on? Any pressing ship or release dates we should be aware of?

IAM UI - no pressing dates.

Steps to reproduce the issue

  1. Step one
  2. Step two
  3. Step three
  4. etc.

Please create a reduced test case in CodeSandbox

Additional information

brittanykvanvig commented 4 years ago

please let me know if you need any more details or the codebox case and I can try to provide those.

TannerS commented 3 years ago

I am having same issue

emyarod commented 3 years ago

can you create a reduced test case in Code Sandbox for easier testing and debugging?

emyarod commented 3 years ago

in the meantime I believe rendering the component with a key each time should resolve this issue