-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Say I have an object like:
export default {
name: "backgroundColour",
title: "Background Colour",
type: "colorlist",
options: {
list: [
{ title: "Black", value: "#000000" },
{ title: "White", value: "#ffffff" },
],
},
initialValue: { title: "White", value: "#ffffff" },
validation: (Rule) => Rule.required(),
}
And I use it in a different schema like so:
export default {
title: "Page area",
name: "pageArea",
type: "object",
fields: [
// other fields
{
title: "Background Colour",
name: "backgroundColour",
type: "backgroundColour",
initialValue: {
title: "Black",
value: "#000000",
},
validation: (Rule) => Rule.required(),
}
]
};
the CMS marks the item's value as invalid when it's intialised. I think this is because it adds an additional field of _type
, or at least it does when it's console.log
ed out.
initialValue: {
title: "Black",
value: "#000000",
_type: "backgroundColour",
},
Am I setting the initialvalue incorrectly? Adding the _type
doesn't seem to make a difference.
heggemsnes and simonandywilson
Metadata
Metadata
Assignees
Labels
No labels