Parent Block Replaced by Text Intended for Child Block #67356
Labels
Needs Technical Feedback
Needs testing from a developer perspective.
[Package] Block editor
/packages/block-editor
[Status] Needs More Info
Follow-up required in order to be actionable.
[Status] Stale
Gives the original author opportunity to update before closing. Can be reopened as needed.
[Type] Bug
An existing feature does not function as intended
Description
When using the BlockEditorProvider and BlockList components in a custom block, pasting copied text into a specific block within the BlockList unexpectedly replaces the entire parent block instead of inserting the text into the intended block. This disrupts the block hierarchy and content structure.
Using the template lock prevents copy-pasting from working entirely, as it stops the replacement of locked parent blocks.
Notably, this issue only occurs when pasting text from outside the editor, for example from the sidebar. When copying text from within the editor, such as from a paragraph block, the behavior works as expected.
Step-by-step reproduction instructions
Here’s a simple block example to help reproduce the issue:
Steps:
Screenshots, screen recording, code snippet
Environment info
The issue can be reproduced starting from WordPress 6.6. On WordPress 6.5.5, the problem does not occur.
Active theme: Twenty Twenty-Four.
No plugins are active, except for the custom block created for this example.
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: