I have some difficulty to display default values of a multiselect component which is contained in a form.
I have a first form that can save data, and i can edit this data with a second form. This second form is populated with a table selectedrow data with the good form data key. All data is ok except the multiselect's one. There's no display of the data & i can't save it back because this data is required.
Data is store in DB so array is converted to string. I try to change the default value with the solution in there, but form data won't change...
and the options of multiselect.
I use a text component, so they can view the options, and i test the value with the stored one before saving to avoid the problem.
It does the job for now.
I updated my options to have labels and values to try and reproduce. As long as the default value is an array of strings that match the values from the options, they get selected:
Which is weird because the tooltip is showing that is an array. Let's try using a Transformer. Define a const data = [], then manually push each filtered element into it, and return the "data" array. Use this transformer as the data source instead.