Clicking field titles causes focus to jump to first input and scroll to top

14 replies
Last updated: Jan 8, 2021
Jumpy focus in the studio! This is odd and very, very annoying: we have a relatively complex schema with 22 fields, some of them inside 3 fieldsets of which 2 are collapsed by default. Clicking title/description of some of those fields will make Studio focus the very first title input and scroll to the top. I have disabled some of our customizations and still see this odd behaviour.
AI Update

This is a known bug in Sanity Studio that has affected multiple users with complex schemas containing fieldsets. When you click on the label or description of fields within collapsed fieldsets, Studio incorrectly focuses the first input (usually the title field) and scrolls to the top instead of focusing the field you actually clicked on.

What's happening

Based on reports from the Sanity community, this issue particularly affects documents where:

  • You have multiple fieldsets (especially 2 or more)
  • Some fieldsets are configured with collapsed: true by default
  • The fieldset rendered last in the document tends to have the most focus issues

The problem is especially frustrating with radio buttons and other controls where users naturally expect to click the label to interact with the field - instead, focus jumps to the top of the page.

History and fixes

This bug was partially addressed in Sanity Studio v2.1.4 (released January 2021), which fixed "form would scroll to top when first focusing a child of a nested field." However, as reported in the community thread, some users continued experiencing focus issues even after that update, particularly with:

  • Fields in the second or last fieldset when multiple fieldsets are collapsed by default
  • Clicking labels of radio buttons and other controls within collapsed fieldsets

Potential workarounds

While waiting for a complete fix:

  1. Temporarily disable collapsed state: Set collapsed: false on your fieldsets to confirm the issue is fieldset-related. This isn't ideal for UX but helps isolate the problem.

  2. Update to the latest Studio version: Run sanity upgrade to ensure you have the latest patches. The focus behavior has been improved over multiple releases.

  3. Reorder fieldsets: If possible, try reordering your fieldsets - the last-rendered fieldset seems most prone to focus issues.

  4. Test with minimal schema: Create a simplified test document with just the problematic fieldsets to isolate whether it's the fieldsets themselves or interaction with other schema features.

Reporting the issue

If you're still experiencing this on the latest Studio version (especially Studio v3 or v4), I'd recommend opening a new issue on the Sanity GitHub repository with:

  • Your exact Studio version (sanity versions)
  • A minimal reproducible schema showing your fieldset configuration
  • Specific steps to reproduce (which field labels cause the jump)
  • Whether you're using Studio v2, v3, or v4

The Sanity team has been responsive to these types of UX bugs, and providing clear reproduction steps helps them prioritize fixes for core editing workflows with fieldsets and collapsed sections.

Show original thread
14 replies
I believe the “focus on first feel when uncollapsing a fieldset” bug was squashed in a update pushed on friday.
I did
sanity upgrade
just before asking, just in case.. Is that update out now?
this open PR might fix this issue https://github.com/sanity-io/sanity/pull/2200
I hope that will solve things, thank you
user B
. Not 100% sure since by description it's only about portable text fields being activated but we see the problem on regular string fields too.. 🤞
I’m experiencing the same bug and this issue from
user A
seems related: https://github.com/sanity-io/sanity/issues/2112
new release is out, might be fixed now 🤞
Fix bug where form would scroll to top when first focusing a child of a nested field.
https://github.com/sanity-io/sanity/releases/tag/v2.1.4
Yep, we’re no longer seeing this bug after upgrading to v2.1.4 🎉
🎉
🎉
Yep, we’re no longer seeing this bug after upgrading to v2.1.4 🎉
🎉
Sorry, still an issue here for some specific clicks..I have two fieldsets collapsed by default, clicking the title of a field in the second one will focus the first input at the top of the page instead of the one I want.
This is worse because some of those controls in that fieldset are radio buttons. Users naturally expect to be able to click the title of the radio button's label to toggle it - instead focus jumps to the top.
It seems to be an issue for all documents where we have more than one fieldset. The fieldset the studio renders last in the document will have focus issues.
(There is a minor bug also if you click the label of a control which is inside a fieldset when the focus is in a control outside that fieldset - the focus first jumps briefly to the first control inside the fieldset, causing a bit of jerk and potentially upward scrolling, then it jumps to the field you want focus in)
sanity versions
says everything is up to date

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?