File size: 1,375 Bytes
ef987bb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # Click-outside behavior for a paragraph editor
Fix the supplied block editor in the root `index.html`. Each paragraph can be opened for editing and closed by clicking anywhere outside that editor, including another paragraph. Closing must return to the non-editing view, not simply remove focus.
## Editing and persistence
Treat whitespace-only input as empty and restore the editable empty paragraph. For nonempty input, keep the typed text in that block and show it when closed. Leading and trailing whitespace may be preserved or trimmed. Show literal HTML characters as text. Save each block independently and restore its text after a reload, without reopening editors. Reopening a block loads its own saved text.
Keep the starter's paragraph hooks (including `block-1`, `block-2`, and `block-3`) and label the active editable control with `data-testid="active-input"`. The page runs directly and offline.
## Acceptance Checklist
- Clicking away closes the editor and either restores the empty state or saves the typed text. Moving between blocks does not mix their values.
- Reopening displays the saved value; changing and closing the editor updates that block alone. All saved blocks survive reload, with editors closed.
- HTML-looking text stays literal. Clearing a paragraph with whitespace persists the empty state while leaving the block available to edit.
|