-
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
Blocks inside a InnerBlocks container with "insert" templateLock can be dragged outside of the container #11131
Comments
May we have some basic steps for testing this? I would like to try to check it out but am not very experienced with coding Gutenberg so a code example would be really awesome. If you don't have one, that's okay and we can wait to see if we can get a response about what the intended behavior is with regard to locked blocks in a template and whether or not it should be possible to drag them out without seeing a code example. |
Sure, no problem. For example, insert this test block in the page: registerBlockType("qqq/qqq", {
title: "qqq",
icon: "carrot",
category: "common",
attributes: {},
edit(props) {
return (
<div>
<InnerBlocks
template={[
["core/quote"],
["core/image"],
["core/quote"]
]}
allowedBlocks={[
"core/quote",
"core/image",
]}
templateLock="insert"
/>
</div>
);
},
save(props) {
return null;
}
}); Add the block inside the page (a quote, an image and a quote will be included inside). I hope it is clear. Thanks. |
This seems to no longer be an issue, since we were unable to reproduce the bug. Blocks weren't able to be dragged out of the container when having templateLock set to "insert". |
Describe the bug
The documentation states:
I might be reading this wrong but I interpreted the lock permits moving the inner blocks within the container but not to/from the outside. So there will always be the blocks set in the template, but they can be reordered.
Currently it is possible to drag inner blocks to the outside (to a different container or the root). If my interpretation is correct this should not be allowed. However, it is not possible to drag a block from the outside to the inside.
Versions
The text was updated successfully, but these errors were encountered: