RichText’s onSplit for block with innerblocks?

[ad_1]

I’m trying to make a blogk that has both richtext and innerblocks. When I press enter in the richtext, it should split to a paragraph into the blocks’ innerblocks.

I tried following this tutorial https://developer.wordpress.org/news/2023/01/17/some-very-cool-things-can-happen-when-you-hit-enter-in-a-block/

But doing this doesn’t seem to preserve the block’s innerblocks’ content 🙁

Also it seems I *have* to return 2 new blocks from that function.

I just want to change the current block. Like I have a <RichText>…</RichText><innerblocks>…</innerblocks> and I want to send the split part from the rich text to the inner blocks of my block, not to a new block inside my block’s parent.

Anyone knows how to do this?

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer