Hello, in our project we want to use the Multiselect widget to offer a selection of items that are grouped by a common type. As the interface MultiselectProps.Item extends DropDownItem we use the children property to put the items we actually want to offer for selection to group items that are only needed for display reasons.
The UI displays the widget with its dropdown-Items as expected but if we click on one of the children items all the grouping items are displayed as selected. In addition to that the setData event is triggered with an empty array of items.
We inspected the source code and found that the Multiselect component uses a function called getFlattenItems in the constructor to transform the props.items into an array of items for further operations. Unexpectedly getFlatttenItems does not consider if an item contains children. It just returns the toplevel items. This leads to unexpected behavior since the children items aren’t present for selection internally in the Multiselect component anymore. The expected behaviour would be that getFlattenItems return an array which contains all children items.
Is there a workaround available for this behavior or is it likely that the Multiselect component should not be designed to consider nested items?
Thank you in advance
Gerrit