Skip to content
Discussion options

You must be logged in to vote

Hey @oliverkierepka you should actually be able to achieve this without a new feature.

admin.readOnly is fully supported on Lexical.

For your specific use case, you could combine admin.readOnly with admin.condition:

{
  name: 'overrideCaption',
  type: 'checkbox',
  defaultValue: false,
},
{
  name: 'caption',
  type: 'richText',
  admin: {
    readOnly: true,  // default: read-only
    condition: () => true, // always shown
  },
},

That said, admin.readOnly is static — it doesn't react to sibling field values at runtime.

To make it dynamic, you'd need a custom field component that reads the checkbox value from form state and conditionally sets readOnly:

'use client'
import { RichTextFie…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zubricks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants