diff --git a/sanityv3/schemas/documents/header/sharedHeaderFields.ts b/sanityv3/schemas/documents/header/sharedHeaderFields.ts index c5050992d..6ddd08f05 100644 --- a/sanityv3/schemas/documents/header/sharedHeaderFields.ts +++ b/sanityv3/schemas/documents/header/sharedHeaderFields.ts @@ -49,7 +49,7 @@ const heroBigTitleDefault = { hidden: ({ parent }: DocumentType) => !parent.isBigTitle || parent.heroType !== HeroTypes.DEFAULT, validation: (Rule: Rule) => Rule.custom((value: PortableTextBlock[], ctx: ValidationContext) => - blocksToText(value)?.length === 0 && + (!value || blocksToText(value)?.length === 0) && (ctx.parent as Hero)?.isBigTitle && (ctx.parent as Hero)?.heroType === HeroTypes.DEFAULT ? 'Title is required' @@ -147,7 +147,7 @@ const heroTitle = { validation: (Rule: Rule) => Rule.custom((value: string, context: ValidationContext) => { const { parent } = context as unknown as DocumentType - if (parent?.heroType === HeroTypes.FIFTY_FIFTY && !value) return 'Field is required' + if (parent?.heroType === HeroTypes.FIFTY_FIFTY && !value && !parent.isBigTitle) return 'Field is required' return true }), }