-
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
TemplateLock does not effect nested blocks #13150
Comments
Hi @floriandagge thank you for submitting this issue. I did some tests, and it seems the locking inheritance is working as specified in the documentation.
I checked that I add the test parent block, the test child block and test grandchild were added. I think the problem you are facing where the column block does not inherit the locking is because the core column block explicitly sets the teamplateLock value to false to avoid inheritance. Column blocks need to do it otherwise it would always get the locking all set by the columns block. And columns block needs a locking all; otherwise, the user would be able to drag single columns out, delete columns using the UI, etc. and we want column management to be done using only the slider. I'm closing the issue for now if you need additional information feel free to reopen the issue and we can look further into the problem. |
Bug Description
I created two custom blocks for Gutenberg, which are nested.
Level 1 Block: "Milestone":
--> only allows the Level 2 Block "Milestone Element"
Level 2 Block: "Milestone Element":
--> Uses core blocks within a template. In addition "templateLock" is set to "all".
As expected, "Milestone Element" is now locked.
Unfortunately, when the focus switches to a nested (core) block, these blocks are not locked.
The current behavior is what I'd expect when using the option "false" (see doc: https://github.com/WordPress/gutenberg/tree/master/packages/editor/src/components/inner-blocks) on nested block level.
As described in documentation, in any other cases (option "false" not set) it should inherit the value from the parent (here: "Milestone element") block to the children (here: "core/image", "core/paragraph", ...) block.
Edit function of Level 1 "Milestone":
Edit function of Level 2 "Milestone element":
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The nested blocks should be locked as well, when the paling block (milestone element) is locked. See inheritance described above / in documentation.
The text was updated successfully, but these errors were encountered: