-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Write Mode: Block Movers appear when content block is immediate child of a section #67408
Copy link
Copy link
Open
Open
Copy link
Labels
[Feature] Write mode[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
Description
In Write Mode, blocks are generally divided into three groups:
- Section blocks: these are blocks near the top level that contain other blocks, they are set to
contentOnlyblock editing mode. They can be moved up and down. - Content blocks: these are inner blocks of the sections that are set to
contentOnlymode. It shouldn't be possible to move them. - Other blocks: blocks that aren't section or content blocks are disabled and unselectable.
For most content blocks that are deeply nested in sections, the block movers don't appear. This is because their parent block is usually set to disabled:

However, if a content block is an immediate child of a section, then the movers do appear due to the parent being set to contentOnly:

The code that governs this is the canMove block selector, the return statement at the end allows movement of a block when the parent is not disabled:
gutenberg/packages/block-editor/src/store/selectors.js
Lines 1871 to 1885 in 35a68f6
| export function canMoveBlock( state, clientId ) { | |
| const attributes = getBlockAttributes( state, clientId ); | |
| if ( attributes === null ) { | |
| return true; | |
| } | |
| if ( attributes.lock?.move !== undefined ) { | |
| return ! attributes.lock.move; | |
| } | |
| const rootClientId = getBlockRootClientId( state, clientId ); | |
| if ( getTemplateLock( state, rootClientId ) === 'all' ) { | |
| return false; | |
| } | |
| return getBlockEditingMode( state, rootClientId ) !== 'disabled'; | |
| } |
Step-by-step reproduction instructions
- Enable the Write Mode experiment (WP Admin Sidebar > Gutenberg > Experiments)
- Switch to Twenty Twenty Four
- Insert the 'Hero' pattern into a template
- Switch to Write Mode
- Select the heading in the pattern, see that there are no block movers
- Select the image in the pattern, see that there are block movers
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- Yes
Please confirm which theme type you used for testing.
- Block
- Classic
- Hybrid (e.g. classic with theme.json)
- Not sure
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Feature] Write mode[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Type
Fields
Give feedbackNo fields configured for Bug.