-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change replaceInnerBlocks updateSelection property to false #26312
Change replaceInnerBlocks updateSelection property to false #26312
Conversation
Size Change: -19 B (0%) Total Size: 1.21 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the plugins used with e2e tests need to be updated to ensure that old behavior is preserved:
template: TEMPLATE_PARAGRAPH_PLACEHOLDER, |
templateInsertUpdatesSelection
should be set to true
there.
It feels like it's a good direction. In most of the cases, the changes applied, they align with the most popular behavior.
0872c11
to
12ab49e
Compare
@ntsekouras thanks for the heads-up about the |
It looks like this PR needs to be rebased. I also marked it as needing a short dev note for WordPress 5.7 release. Can you compile something upfront so the process is more streamlined? |
2e14a44
to
bb7bcb9
Compare
Dev Note for this change. (thank you @gziolo for the intro) Inner Blocks API ChangesWe noticed that the majority of block authors prefer to keep the focus on the parent block upon insertion in the editor rather than move it to one of the child blocks. Prior to the changes introduced the default behavior was the latter, so we decided to change it to follow the more popular choice that is going to simplify API usage. To accomplish that we had to change the definition of the following parts of API:
|
@ntsekouras, how do you feel about using the following intro to this dev note that explains the reasoning behind these changes: Inner Blocks API ChangesWe noticed that the majority of block authors prefer to keep the focus on the parent block upon insertion in the editor rather than move it to one of the child blocks. Prior to the changes introduced the default behavior was the latter, so we decided to change it to follow the more popular choice that is going to simplify API usage. To accomplish that we had to change the definition of the following parts of API:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, thank you for all the work on these changes.
Description
Based on this comment: #26267 (review)
This PR changes the default value of action
replaceInnerBlocks
'supdateSelection
property tofalse
. This change propagates to changing the default value ofInnerBlock
'stemplateInsertUpdatesSelection
tofalse
as well.This change affects whether the selection is updated or not, when child blocks in the template are inserted.
Most blocks that use
InnerBlocks
would set this asfalse
, thus making this change the preferred default value.How has this been tested?
Affected blocks:
Hooks
Native files/Blocks/Components changed
You can test this by creating the above affected blocks on master and the on this branch. Block
focus
should be identical.Checklist: