fix(richtext-slate): re-enable toolbar buttons after failed save#17100
fix(richtext-slate): re-enable toolbar buttons after failed save#17100Ma-Kas wants to merge 1 commit into
Conversation
|
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. |
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
setClickableStatedisables the toolbar buttons. When processing ends it is re-enabled:setAttributestringifies, so the enable case setsdisabled="null"instead of removing the attribute.disabledis 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:The change is contained to the Slate toolbar.
setClickableStateexists only in this file, and nothing in the repo reads thedisabledattribute, so nothing depended on the old value.