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

[Bug]: React: Controlled <FilterableMultiSelect> does not update when data is changed externally #11457

Closed
2 tasks done
freder opened this issue May 23, 2022 · 2 comments
Closed
2 tasks done

Comments

@freder
Copy link

freder commented May 23, 2022

Package

@carbon/react

Browser

Chrome

Package version

1.3.0

React version

17, 18

Description

I'm using FilterableMultiSelect with the selectedItems items prop, which makes it a controlled component – at least that would be my expectation. however:

  1. I still need initialSelectedItems to pre-select items (why?)
  2. more importantly: changing the selected data externally (via useState hook) does not seem change the component state

Reproduction/example

https://stackblitz.com/edit/github-cpq1kc?file=src%2FApp.jsx

Steps to reproduce

  • add / remove items via FilterableMultiSelect component itself
  • then remove items via buttons below
  • observe how FilterableMultiSelect component does not update

Code of Conduct

@tay1orjones
Copy link
Member

@freder MultiSelect supports the selectedItems prop, FilterableMultiSelect does not yet have this prop available. #10340

@tay1orjones
Copy link
Member

Duplicate of #10340

@tay1orjones tay1orjones marked this as a duplicate of #10340 Sep 19, 2022
@tay1orjones tay1orjones closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2022
@tay1orjones tay1orjones moved this to ✅ Done in Design System Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants