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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR adds an additional check to the mergeBlocks action to prevent a block from being merged into a block that is disabled.
Why?
Blocks that are disabled shouldn't be able to be modified.
How?
Adds an extra check to the mergeBlocks action to check that the blocks current edit mode isn't disabled
Testing Instructions
Note
wp.data needs to be exposed to run the console command
Create a post
Add two paragraphs
Open console run the following wp.data.dispatch('core/block-editor').setBlockEditingMode( wp.data.select('core/block-editor').getBlocks()[0].clientId, 'disabled')
in the second paragraph put the cursor to the front of the block
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.
If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @jrmd! In case you missed it, we'd love to have you join us in our Slack community.
If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.
I just realized that we also need to handle the forward delete case. Here are the reproduction steps:
Add two paragraphs.
Disable the second paragraph - wp.data.dispatch('core/block-editor').setBlockEditingMode( wp.data.select('core/block-editor').getBlocks()[1].clientId, 'disabled').
Place a caret at the end of the first paragraph.
Press forward delete. Fn+Delete on Mac.
Expected: The disabled second block should be merged into the first block.
[Feature] Rich TextRelated to the Rich Text component that allows developers to render a contenteditableFirst-time ContributorPull request opened by a first-time contributor to Gutenberg repository[Package] Block editor/packages/block-editor[Type] BugAn existing feature does not function as intended
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Closes #69915
This PR adds an additional check to the mergeBlocks action to prevent a block from being merged into a block that is disabled.
Why?
Blocks that are disabled shouldn't be able to be modified.
How?
Adds an extra check to the
mergeBlocks
action to check that the blocks current edit mode isn'tdisabled
Testing Instructions
Note
wp.data
needs to be exposed to run the console commandScreenshots or screencast
Before
Screen.Recording.2025-04-16.at.13.03.49.mov
After
Screen.Recording.2025-04-16.at.13.30.05.mov