Default value
Hi, is possible for required field set a default value?
Thanks a lot. Great Job!!
I found the solution:
strapi-plugin-multi-select/admin/src/components/MultiSelect/index.js
const sanitizedValue = useMemo(() => { let parsedValue try { parsedValue = JSON.parse(value || attribute['default']) } catch (e) { parsedValue = [] } return Array.isArray(parsedValue) ? possibleOptions.filter((option) => parsedValue.some((val) => option.value === val), ) : [] }, [value, possibleOptions])
in json of configuration can use this:
"options": [ "A:a", "B:b", "C": c" ], "required": true, "default": ["a"],
Is possibile include this code in the distribution? Thanks
@Zaydme ping? Would be amazing to have this feature
Edit: I also created a pull request, if its fine a merge would be amazing https://github.com/Zaydme/strapi-plugin-multi-select/pull/19
closed in https://github.com/Zaydme/strapi-plugin-multi-select/commit/073af312d5bfba80ab5e005b0faa0b6631bc90c6 available in @2.1.0