Change replaceInnerBlocks updateSelection property to false#26312
Change replaceInnerBlocks updateSelection property to false#26312ntsekouras merged 8 commits intomasterfrom
Conversation
|
Size Change: -19 B (0%) Total Size: 1.21 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
One of the plugins used with e2e tests need to be updated to ensure that old behavior is preserved:
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:
|
gziolo
left a comment
There was a problem hiding this comment.
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'supdateSelectionproperty tofalse. This change propagates to changing the default value ofInnerBlock'stemplateInsertUpdatesSelectiontofalseas well.This change affects whether the selection is updated or not, when child blocks in the template are inserted.
Most blocks that use
InnerBlockswould 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
focusshould be identical.Checklist: