Description wiped when a form is submitted before Editor.js has loaded #42

Closed
opened 2026-11-02 18:50:46 +01:00 by miko · 1 comment
Owner

Problem

GuideForm and CategoryForm only put description into the form data when the Editor.js instance exists (editorRef.current). If the form is submitted before the editor has loaded, the field is missing, formText reads it as empty, and the server saves the description as SQL NULL. The existing description is lost without warning.

Where

  • src/guides/components/GuideForm.tsx (submit)
  • src/categories/components/CategoryForm.tsx (submit, since #41)
  • src/richText/submission.ts (descriptionFrom)

Acceptance criteria

  • Submitting before the editor is ready never clears a stored description (e.g. keep it unchanged when the field is absent, or disable submit until the editor is ready)
  • Applies to guides and categories alike
## Problem `GuideForm` and `CategoryForm` only put `description` into the form data when the Editor.js instance exists (`editorRef.current`). If the form is submitted before the editor has loaded, the field is missing, `formText` reads it as empty, and the server saves the description as SQL NULL. The existing description is lost without warning. ## Where - `src/guides/components/GuideForm.tsx` (`submit`) - `src/categories/components/CategoryForm.tsx` (`submit`, since #41) - `src/richText/submission.ts` (`descriptionFrom`) ## Acceptance criteria - [ ] Submitting before the editor is ready never clears a stored description (e.g. keep it unchanged when the field is absent, or disable submit until the editor is ready) - [ ] Applies to guides and categories alike
Author
Owner

Fixed in PR #45: a guide, category or step form sent before Editor.js has loaded no longer clears the stored description/content. A missing rich text field now means "unchanged"; an empty one still clears it. Covered by unit tests and e2e/richText.spec.ts (Editor.js blocked).

Fixed in PR #45: a guide, category or step form sent before Editor.js has loaded no longer clears the stored description/content. A missing rich text field now means "unchanged"; an empty one still clears it. Covered by unit tests and e2e/richText.spec.ts (Editor.js blocked).
miko closed this issue 2026-11-02 19:11:03 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MassiveDynamic/kataba#42
No description provided.