[GH-ISSUE #2916] [Bug] Removing last block in a document makes its body uneditable #1281

Closed
opened 2026-03-23 20:47:21 +00:00 by mirror · 1 comment
Owner

Originally created by @vedant-pandey on GitHub (Jun 30, 2023).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/2916

Originally assigned to: @LucasXu0 on GitHub.

Bug Description

When you delete the last block on a document it makes the body of the document uneditable.

How to Reproduce

  1. Create a new document
  2. Add anything on the only line which exists on the block
  3. Delete the block
  4. You cannot edit the document anymore

Expected Behavior

There should always be at least one block in the body of the page

Operating System

Mac OS - Ventura 13.4 (22F66)

AppFlowy Version(s)

Latest commit - github.com/AppFlowy-IO/AppFlowy@95d4fb6865

Screenshots

https://github.com/AppFlowy-IO/AppFlowy/assets/25723331/9a64d24d-7a74-49df-999a-19a949b18dbd

Additional Context

No response

Originally created by @vedant-pandey on GitHub (Jun 30, 2023). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/2916 Originally assigned to: @LucasXu0 on GitHub. ### Bug Description When you delete the last block on a document it makes the body of the document uneditable. ### How to Reproduce 1. Create a new document 2. Add anything on the only line which exists on the block 3. Delete the block 4. You cannot edit the document anymore ### Expected Behavior There should always be at least one block in the body of the page ### Operating System Mac OS - Ventura 13.4 (22F66) ### AppFlowy Version(s) Latest commit - https://github.com/AppFlowy-IO/AppFlowy/commit/95d4fb68654f008bc0562e8f69c07faba5fab6d4 ### Screenshots https://github.com/AppFlowy-IO/AppFlowy/assets/25723331/9a64d24d-7a74-49df-999a-19a949b18dbd ### Additional Context _No response_
mirror 2026-03-23 20:47:21 +00:00
  • closed this issue
  • added the
    bug
    editor
    labels
Author
Owner

@LucasXu0 commented on GitHub (Jun 30, 2023):

Fixed in this commit. https://github.com/AppFlowy-IO/AppFlowy/pull/2913.

I have added some rules to ensure that there must be at least one paragraph, and the last node must also be a paragraph.

<!-- gh-comment-id:1614328052 --> @LucasXu0 commented on GitHub (Jun 30, 2023): Fixed in this commit. https://github.com/AppFlowy-IO/AppFlowy/pull/2913. I have added some rules to ensure that there must be at least one paragraph, and the last node must also be a paragraph.
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
AppFlowy-IO/AppFlowy#1281
No description provided.