Description wiped when a form is submitted before Editor.js has loaded #42
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MassiveDynamic/kataba#42
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
GuideFormandCategoryFormonly putdescriptioninto 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,formTextreads 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
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).