You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rich text: Backspace at the start of a paragraph with an active format crashes the editor (insertBefore NotFoundError) #87100
Pressing Backspace at the start of a paragraph while a format is active (for example, after pressing → to enter bold text at the start of the paragraph) merges the paragraph into the previous block on the canvas, while the block editor still has two separate blocks. Inserting a block next to it then crashes the editor.
The crash seen is:
NotFoundError: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
I expect Backspace to merge the two blocks as it does when no format is active, without the canvas and the block list getting out of step.
Step-by-step reproduction instructions
Create a post with these blocks: a Heading, a Paragraph that starts with bold text (e.g. "Key point: first paragraph text."), and at least one more Paragraph.
Click into the bold-leading paragraph and press Home.
Press → once. The caret doesn't move; it enters the bold format boundary.
Press Backspace. On the canvas, the paragraph's text joins the end of the heading, but List View still shows the Paragraph as a separate block.
I confirmed the cause with local builds and a Playwright probe, in Chromium on macOS. It was introduced by #79105.
Paragraph, Heading and List item support editableRoot, so while one of them is selected and has siblings, the whole canvas is a single editing host. A delete the editor doesn't cancel is performed by the browser, which merges the block's element into its neighbour. The store keeps both blocks, and the next block inserted before the removed element makes React call insertBefore on a node that has left the block list.
The Backspace/Delete handler in packages/block-editor/src/components/rich-text/event-listeners/delete.ts only cancels the key and merges through the store when the caret is collapsed at the edge with no active formats, so Backspace with an active format falls through to the browser. Removing the hasActiveFormats condition fixes that case.
Other deletes at a block's edge crash the same way, because they don't arrive as a Backspace or Delete keydown, e.g. Ctrl+H on macOS.
Activity
dsas commentedon Nov 19, 2026
I confirmed the cause with local builds and a Playwright probe, in Chromium on macOS. It was introduced by #79105.
Paragraph, Heading and List item support
editableRoot, so while one of them is selected and has siblings, the whole canvas is a single editing host. A delete the editor doesn't cancel is performed by the browser, which merges the block's element into its neighbour. The store keeps both blocks, and the next block inserted before the removed element makes React callinsertBeforeon a node that has left the block list.The Backspace/Delete handler in
packages/block-editor/src/components/rich-text/event-listeners/delete.tsonly cancels the key and merges through the store when the caret is collapsed at the edge with no active formats, so Backspace with an active format falls through to the browser. Removing thehasActiveFormatscondition fixes that case.Other deletes at a block's edge crash the same way, because they don't arrive as a Backspace or Delete
keydown, e.g. Ctrl+H on macOS.