Skip to content

fix(richtext-slate): re-enable toolbar buttons after failed save#17100

Open
Ma-Kas wants to merge 1 commit into
payloadcms:3.xfrom
Ma-Kas:fix/slate-toolbar-disabled-after-save
Open

fix(richtext-slate): re-enable toolbar buttons after failed save#17100
Ma-Kas wants to merge 1 commit into
payloadcms:3.xfrom
Ma-Kas:fix/slate-toolbar-disabled-after-save

Conversation

@Ma-Kas

@Ma-Kas Ma-Kas commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What?

Re-enables the Slate rich text editor toolbar buttons after a failed save. When a save fails validation, every toolbar button, built-in and custom, on the edit view is disabled until a hard reload.

Why?

While the form is processing, the field is disabled and setClickableState disables the toolbar buttons. When processing ends it is re-enabled:

child.setAttribute('disabled', isDisabling ? 'disabled' : null)

setAttribute stringifies, so the enable case sets disabled="null" instead of removing the attribute. disabled is a boolean attribute, so its presence alone keeps the button disabled. On a failed save the user stays on the edit view, so the toolbar is left disabled until a reload. A successful save navigates away, which is why it only shows up on failures.

How?

Remove the attribute on the enable path instead of setting it to null:

if (isDisabling) {
  child.setAttribute('disabled', 'disabled')
} else {
  child.removeAttribute('disabled')
}

The change is contained to the Slate toolbar. setClickableState exists only in this file, and nothing in the repo reads the disabled attribute, so nothing depended on the old value.

@Ma-Kas Ma-Kas requested a review from AlessioGr as a code owner June 24, 2026 12:29
@github-actions

Copy link
Copy Markdown
Contributor

Pull Request titles must follow the Conventional Commits specification and have valid scopes.

Unknown scope "richtext-slate" found in pull request title "fix(richtext-slate): re-enable toolbar buttons after failed save". Scope must match one of: cpa, claude, codemod, db-*, db-d1-sqlite, db-mongodb, db-postgres, db-vercel-postgres, db-sqlite, db-d1-sqlite, drizzle, email-*, email-nodemailer, email-resend, eslint, evals, graphql, kv, kv-redis, live-preview, live-preview-react, live-preview-vue, next, payload-cloud, plugin-cloud, plugin-cloud-storage, plugin-ecommerce, plugin-form-builder, plugin-import-export, plugin-mcp, plugin-multi-tenant, plugin-nested-docs, plugin-redirects, plugin-search, plugin-sentry, plugin-seo, plugin-stripe, richtext-*, richtext-lexical, sdk, skills, storage-*, storage-azure, storage-gcs, storage-r2, storage-uploadthing, storage-vercel-blob, storage-s3, translations, ui, templates, examples(/(\w|-)+)?, deps.

feat(ui): add Button component
^    ^    ^
|    |    |__ Subject
|    |_______ Scope
|____________ Type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant