I've developing a custom widget for Experience Builder, and I'm having issues implementing the Jimu Multiselect control, documented here: https://developers.arcgis.com/experience-builder/storybook/?path=/docs/components-jimu-ui-index-mult...
I can populate the multiselect with items, and I am capturing the item click event. What I can't work out, is how to set a default selection. When the multiselect is first opened, it looks like this:
![DominicRorke1_0-1692874112081.png DominicRorke1_0-1692874112081.png](https://community.esri.com/t5/image/serverpage/image-id/79027i01EB147C80E3F62F/image-dimensions/164x149?v=v2)
And I want to be able to check some of these items by default, such as this:
![DominicRorke1_1-1692874179620.png DominicRorke1_1-1692874179620.png](https://community.esri.com/t5/image/serverpage/image-id/79028i10F37A4A15FDDC23/image-dimensions/167x146?v=v2)
I've tried implementing the 'defaultValues' property, but with no more than the very limited documentation provided by ESRI, and a storybook component that crashes when I click 'Set object' for this property, I have not been able to get this working:
![DominicRorke1_2-1692874372434.png DominicRorke1_2-1692874372434.png](https://community.esri.com/t5/image/serverpage/image-id/79029i86CC8586ADEDA54A/image-dimensions/548x89?v=v2)
Here's my code for reference (without any attempt to set default selection):
<MultiSelect
onClickItem={(e, value, allSelections) => itemClicked(e, value, allSelections)}
displayByValues={function noRefCheck () {}}
buttonProps={{
size: 'sm',
icon: true,
title: 'Toggle columns',
className: 'btn_columnToggle'
}}
items={[
{
label: 'Item 1',
value: 'item-1'
},
{
label: 'Item 2',
value: 'item-2'
},
{
label: 'Item 3',
value: 'item-3'
},
{
label: 'Item 4',
value: 'item-4'
}
]}
/>
</div>
Appreciate if you can help me with this, as I'd quite like to use this Jimu component.
ESRI - Please improve your documentation for the Jimu component library, and for Widget development generally.