当添加到编辑器中时,自定义古腾堡块侧重于内部块



我创建了一个带有嵌套内部块的自定义Gutenberg块。编辑功能看起来像:

edit: (props) => {
<div className="custom-block">
<InnerBlocks
template={[
[ 'core/columns', {'className': 'page-layout-columns columns is-multiline'}, [
[ 'core/column', {'className': 'column is-two-thirds-desktop is-full-tablet is-full-mobile page-layout-main'},[['core/paragraph', {'placeholder': 'Main content area. Start typing to add content, or remove this default paragraph block and then add new blocks.'}]] ],
[ 'core/column', {'className': 'column is-one-quarter-desktop is-full-tablet is-full-mobile page-layout-sidebar'},[['core/paragraph', {'placeholder': 'Sidebar content area. Start typing to add content, or remove this default paragraph block and then add new blocks.'}]]],
]
]]}
/>
</div>}

当这个块被添加到编辑器中时,核心列块被聚焦,而不是块包装器。我应该怎么做才能使块包装器成为最初的焦点?如有任何意见,我们将不胜感激。谢谢

对于那些也有这个问题的人,有一个属性templateInsertUpdatesSelection={false}它可以移除列块上的自动聚焦。

最新更新