contentOnly
locking and allowedBlocks
is not respected in blocks without a layout
attribute.
#63820
Closed
2 tasks done
Labels
[Feature] Block Locking
The API allowing for the ability to lock/unlock blocks
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Description
I just stumbled upon this. If you have a block with
"templateLock":"contentOnly"
set, the Editor will not respect this attribute if there is nolayout
attribute as well. This is very bizarre, and it is not clear why the two are tied together. Furthermore, it makes it impossible to create patterns that utilizecontentOnly
but have no layout constraint.Edit: I discovered that this issue also occurs when using the
allowedBlocks
attribute. Unless the block also has alayout
attribute, theallowedBlocks
restriction will not be implemented.Step-by-step reproduction instructions
To replicate this issue, copy the following code into the Editor and see that content-only mode is enabled.
Works
Now copy this code into the Editor and see that the mode no longer works and the
"templateLock":"contentOnly"
gets stripped out if you toggle on the Layout option "Inner blocks use content width".Doesn't work
cc @Mamaduka and @jorgefilipecosta as I know you both have worked on block locking and content only.
Screenshots, screen recording, code snippet
layout
setlayout
setEnvironment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
The text was updated successfully, but these errors were encountered: