-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Make MenuItem key in ComboBox to use unique id first #4969
Comments
Hi 👋 would you want to create a reduced case based on https://codesandbox.io/s/github/carbon-design-system/carbon/tree/master/packages/react/examples/codesandbox? Thanks! |
Seems that the problem does not reproduce in the Sandbox. Downloading the content to the local machine yielded the same result. Also I couldn't open the dropdown in the Sandbox. Probably more work is needed in the Sandbox...? |
Here is the sample code.
|
This change swiches React `key`s of the items of `<Dropdown>` as well as the one of `<ComboBox>` from their text content to provided keys in data. This is applying the corresponding logic of `<MultiSelect>`. In this way duplicate item text won't yeild duplicate React keys. Fixes carbon-design-system#4969.
This change swiches React `key`s of the items of `<Dropdown>` as well as the one of `<ComboBox>` from their text content to provided keys in data. This is applying the corresponding logic of `<MultiSelect>`. In this way duplicate item text won't yeild duplicate React keys. Fixes #4969.
What package(s) are you using?
carbon-components
carbon-components-react
Detailed description
Describe in detail the issue you're having. Is this a feature request (new
component, new icon), a bug, or a general issue?
Steps to reproduce the issue
Giving two items with save text but with different id can reproduce it.
https://codesandbox.io/s/wizardly-pond-q3uh0?fontsize=14&hidenavigation=1&theme=dark
Additional information
Add labels
Please choose the appropriate label(s) from our existing label list to ensure
that your issue is properly categorized. This will help us to better understand
and address your issue.
The text was updated successfully, but these errors were encountered: