I’ve noticed multiple bugs in the current implementation of the UI kit’s Select element when used with MacroConfig.
Firstly, if you set “isMulti” and select options, when reopening the config, these options are no longer selected by default. This is surely a bug, making the multi mode barely usable.
Secondly, using config resolvers yields extremely weird results for the resulting select field. I have a country selection, which formats multiple results like so:
extensionContext: {
contentId: '229513',
spaceKey: 'GTP',
config: {
geo: '[DE, AQ]',
startTime: '2004-01-16',
endTime: '2020-09-16',
keyword: 'abcd;efg'
}
}
Notice the formatting of geo is messed up. It is not produced by JSON.stringify (and therefore cannot be JSON.parsed). I currently use this function to parse results from select fields:
config.geo = config.geo
.substr(1, config.geo.length-2)
.split(',')
.map((entry) => entry.trim())
This seems odd and unintended. Please also dig into why the serialization of select fields is so weird.
All the best