Open motherchucker opened 1 year ago
Thanks for the report! This might be some kind of referential equality issue present in internal/Selection.js
, but I'm not totally sure.
I'm going to mark this as a severity 3 since the user still has the ability to view the selected items, and devs have a workaround by explicitly referring to items in the existing array as you demonstrate. Also I think you could use selectedItems
to filter down items
and get the matching indicies to support dynamic values as you describe.
@tay1orjones can i give this a go?
Package
carbon-components-react
Browser
Chrome
Package version
v7.52.0
React version
v17.0.2
Description
Configuration for MultiSelect:
items:
selectedItems:
Expected behaviour:
Initial selected items should be on the top when opening the selection.
Actual behaviour:
They stay on the same index. The items are checked, but they aren't on the top, ever:
If we pass initialSelectedItems like this, everything works ok, but that is not suitable for dynamic values:
Suggested Severity
Severity 2 = User cannot complete task, and/or no workaround within the user experience of a given component.
Reproduction/example
https://codesandbox.io/s/selectionfeedback-bug-dcq7gy
Steps to reproduce
The examples can be tested out in the sandbox by commenting/uncommenting the provided initialSelectedItems examples:
Code of Conduct