Fix for locked input fields in sanity-input-tabs with initial values

12 replies
Last updated: Nov 12, 2021
is there a simple fix for locked input fields when using
sanity-input-tabs
? i remember seeing the issue is something to do with a lost focus due to the tabs and can be solved with initial values
AI Update

I appreciate you remembering seeing something about this issue, but I need to be honest: I cannot find official documentation or verified sources that confirm the initialValue fix for locked input fields with sanity-input-tabs.

The sanity-input-tabs is a community plugin that's not officially maintained by Sanity, and I don't have access to reliable documentation about this specific issue or its solution. While initialValue is definitely a valid schema property in Sanity, I can't verify the claim that it specifically fixes locked/focus issues with this tabs plugin.

What I can suggest:

If you're using Sanity v3, consider using the built-in fieldsets feature with collapsible options instead of the community tabs plugin. While fieldsets don't create actual tabs, they do provide visual grouping with collapsible sections that are officially supported and well-documented:

{
  title: 'My Section',
  name: 'myFieldset',
  options: {
    collapsible: true,
    collapsed: false,
    columns: 2
  },
  fields: [
    // your fields here
  ]
}

If you need actual tabs, there are other community plugins you might explore, though I'd recommend checking their GitHub repositories for recent maintenance activity and known issues.

If you want to continue troubleshooting the sanity-input-tabs issue, I'd suggest:

  • Checking the plugin's GitHub repository for open/closed issues about locked fields
  • Reaching out to the Sanity community Slack where other users might have encountered this specific problem
  • Testing whether the initialValue approach you remember actually works in your specific setup

I wish I could confirm the fix you remember seeing, but without being able to verify it against reliable sources, I don't want to give you potentially incorrect technical advice.

Show original thread
12 replies
Hey User! To clarify, are the fields becoming
readOnly
? In terms of using initial value, just a shot in the dark, but if you set them to something like an empty string does it work?
hi, they are not becoming read only, they look and act like normal input fields but don’t track any input that goes in. this is also happening inside objects without the tabs plugin, so forget that piece
What version of the Studio are you running and can you share an example of the schema where this is happening?
this is happening on one document in particular, and the fields that are not updating are part of an
object
inside the document
i’ve just updated now to the latest version of the studio, i was on an outdated version previously
this is the schema
export default {
	name: 'project',
	title: 'Project',
	type: 'document',
	fields: [
		{
			name: 'video',
			title: 'Video (16:9)',
			type: 'object',
			validation: Rule => Rule.required(),
			fields: [
				{
					title: 'Video URL (16:9)',
					name: 'videoUrl',
					type: 'video',
				},
			],
		},
	],
};
and
video
looks like

export default {
	name: 'video',
	title: 'Video',
	icon: Icon,
	type: 'object',
	fields: [
		{
			name: 'title',
			title: 'Title',
			type: 'string',
		},
		{
			name: 'videoId',
			title: 'Video ID (Vimeo)',
			type: 'string',
			validation: Rule => Rule.required(),
		},
		{
			name: 'showControls',
			title: 'Show Controls?',
			type: 'boolean',
		},
	],
};
Thanks for sharing. Let me see if I can replicate...
I'm not getting the behavior you're describing. Is this happening with all of the documents of the
project
type or a single document of that type?
i figured it out! it was slightly different, but i needed to add a hidden field with a default value inside the object
thanks for your help
Glad you got it sorted out!

Sanity – Build the way you think, not the way your CMS thinks

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.

Was this answer helpful?