Disable "click to activate" in block content editor
I understand your frustration with the "click to activate" feature in the block content editor! Unfortunately, there isn't a built-in configuration option to disable the "click to activate" behavior in Sanity's Portable Text Editor. This activation step is part of how the editor manages focus and prevents accidental edits.
However, here are some approaches that might help:
Workarounds and Considerations
1. Keyboard Navigation The fastest way to work with multiple block editors is using keyboard shortcuts:
- Press
Tabto move between fields - Once focused, you can immediately start typing without clicking
- Use
Shift + Tabto navigate backwards
2. Custom Input Component If this is a significant workflow issue, you could create a custom input component that modifies the Portable Text Editor's behavior. This would involve:
- Using the
components.inputproperty in your schema - Wrapping or extending the default Portable Text input
- Potentially auto-focusing the editor on mount
However, this approach requires careful consideration as it could lead to:
- Unintended focus stealing when scrolling through documents
- Accessibility issues for keyboard users
- Conflicts with Sanity's real-time collaboration features
3. Consider the Design Intent The "click to activate" pattern exists to:
- Prevent accidental edits while scrolling
- Clearly indicate which editor has focus (important for real-time collaboration)
- Improve performance with many rich text fields on one page
Example Custom Input (Advanced)
If you want to explore a custom solution, here's a starting point:
import {PortableTextInput} from 'sanity'
const AutoFocusPortableText = (props) => {
return <PortableTextInput {...props} />
// You'd need to add custom focus logic here
}
// In your schema
{
name: 'content',
type: 'array',
of: [{type: 'block'}],
components: {
input: AutoFocusPortableText
}
}Keep in mind that modifying focus behavior can create usability issues, so test thoroughly with your editorial team before implementing any custom solution.
If this is a common pain point for your team, consider sharing your use case in the Sanity Community Slack or creating a feature request on GitHub—the team is always looking for feedback to improve the editing experience!
Show original thread7 replies
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.