
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI can see why you're experiencing issues with mailto: validation! This is actually a known quirk with how Sanity's URL field type works in the browser.
The good news is your validation rule is correctly configured:
validation: (Rule) => Rule.required().uri({scheme: ['http', 'https', 'tel', 'mailto']})What's happening:
When you use type: 'url' in Sanity, it renders as an HTML <input type="url"> element. The browser's native HTML5 validation for URL input fields doesn't recognize mailto: or tel: as valid URL formats, even though they're perfectly valid URI schemes. This creates a conflict where Sanity's validation passes, but the browser blocks the form submission with its own validation error.
The solution:
Change your field type from url to string while keeping your validation rule exactly as is:
{
name: 'link',
title: 'Link',
type: 'string', // Changed from 'url'
validation: (Rule) => Rule.required().uri({
scheme: ['http', 'https', 'tel', 'mailto']
})
}This approach:
Rule.uri() validationmailto: and tel:The url field type is essentially a string field with some UI conveniences and browser-level validation. By using string with Rule.uri(), you get all the validation you need without the browser interference. The field will still validate that your users enter properly formatted URIs with the schemes you've specified - it just won't fight with the browser about what constitutes a "valid URL."
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store