admin管理员组文章数量:1201401
My InnerBlock child block doesn't seem to respect the block.json "supports" property and I can't understand why not.
For reference, this custom block is comprised of:
- a parent
ucomm-blocks/accordion-block
- a child
ucomm-blocks/accordion-block-item
The relevant parts of their block.json files look like this...
accordion-block.json
{
"$schema": ".json",
"apiVersion": 2,
"name": "ucomm-blocks/accordion-block",
"title": "Accordion",
"icon": "menu",
"category": "ucomm-blocks",
"allowedBlocks": [
"ucomm-blocks/accordion-block-item"
],
"attributes": {
// non-relevant attributes
}
}
accordion-block-item.json
{
"$schema": ".json",
"apiVersion": 2,
"name": "ucomm-blocks/accordion-block-item",
"title": "UConn Accordion Item",
"icon": "menu",
"category": "ucomm-blocks",
"parent": [
"ucomm-blocks/accordion-block"
],
"allowedBlocks": [
"core/columns",
"core/cover",
"core/embed",
"core/group",
"core/heading",
"core/image",
"core/list",
"core/paragraph",
"core/separator",
"core/spacer"
],
"attributes": {
"backgroundColor": {
"type": "string"
}
},
"supports": {
"anchor": true,
"color": {
"background": true,
"text": true,
"gradients": false,
"link": false
}
}
}
When I add the supports.color
property to the parent, the background/text color picker appears as expected for the parent. However, adding it to the child doesn't appear to do anything. The allowedBlocks
of the accordion items all work correctly as well. No errors are thrown regarding the accordion block and I haven't found anything in the documentation that accounts for this. In all other respects these blocks work correctly. What am I doing wrong here?
Thanks for any help you can provide.
本文标签:
版权声明:本文标题:plugin development - Is there an additional block.json property to set to get an InnerBlocks child to respect the "supp 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738633346a2103881.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论