Already seen: Setting a default value for Multi Select Field in Data Manipulation Plugin while using an Initial Request
Hi! How can I set multiple default values for a multi select? Here is a simplified example below:
.addMultiSelect<number, SelectFieldConfigSettings<number>>({
path: 'steps',
name: 'Steps',
defaultValue: [1, 2, 3], // ERROR HERE
settings: {
allowCustomValue: true,
isClearable: true,
options: [{ label: '1', value: 1 }, { label: '2', value: 2 }, { label: '3', value: 3 }],
},
})
The code breaks at the defaultValue - because it wants a number only and not number[]. I can set the default value to 1 for example which works but only sets that one option as its default.
As a side point, I’d also like to leave options: [] blank because for this input selector, I want the user to be able to input their own arbitrary amount and values of numeric options. Is this possible?
Thanks,
Nicolas