Comments (3)
@jordanl17 ah thanks, I missed that in the docs 😅
from sanity.
Hi eliasm307 thank you for reporting and all the details added.
We can reproduce it internally and the bug has been added to triage, we will keep this issue updated once it's fixed.
from sanity.
Hello,
You are facing this issue as validation: (Rule) => Rule.required()
will only check for any value. Specifically, for validity of an image or file field, an asset must be present to be considered defined. Please update the validation on the mainImage
as below:
import type { FieldDefinition } from "sanity";
export const MainImageField: FieldDefinition<"image"> = {
name: "mainImage",
title: "Image principale",
type: "image",
validation: (Rule) => Rule.required().assetRequired(), // specifically require field value to have an asset assigned
fields: [
{
name: "alt",
type: "string",
title: "Texte alternatif de l'image",
validation: (Rule) => Rule.required(), // sub-field is also required
},
],
};
from sanity.
Related Issues (20)
- Hotspot cropping preview doesn't respect curent crop HOT 3
- Mark selected menu item doesn't work as it works for default menu items HOT 1
- TypeGen does not generate correct type when querying an array containing multiple references types HOT 1
- Opening one collapsible column field causes it's neighbor to disappear because they are bottom aligned. HOT 1
- Pasting in PTE not working on Firefox HOT 1
- Cannot delete documents from a migration script HOT 1
- Automatically infer types of queries using groq and @sanity/codegen HOT 1
- error cannot read properties of null (reading 'scrollTop') HOT 2
- Text isn't pasted into Portable Text Editor in Firefox HOT 1
- Limiting documents in document pane to 2000 HOT 1
- Type generation incompatible with Astro
- Documents are appearing in Gatsby / Gatsby's GraphQL browser / the Vision tool / CLI, but missing in Studio HOT 2
- [urgent] Webhook deleted but still pinging the middleware at Vercel
- Unprotected use of process.env. SANITY_INTERNAL_ENV breaks Studio when it's created from client, as in @sanity/astro HOT 2
- Insert menu for portable text editor blocks
- Bug when using compnent in adocument
- Possible ESM issue when running sanity typegen extract
- "Select" button no longer appears in image field HOT 4
- Sanity's dependency on `@sentry/react` should not exist - devDependency instead HOT 1
- Peer deps issue when running `npx sainty init` in fresh nextjs app
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sanity.