plugin development – How to insert text at the current cursor position in Gutenberg?

Question

I am trying to insert text into Gutenberg at the current position for a speech to text solution.

I am aware how to insert new blocks.

const newBlock = wp.blocks.createBlock( "core/paragraph", {
    content: 'This is the content',
});
wp.data.dispatch( "core/editor" ).insertBlocks( newBlock );

But I can’t figure out how to add a string at the current cursor position. Could somebody please give me a hint. Any help appreciated.

0
Rockiger 4 weeks 2021-08-28T15:57:58-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse