Insert text at the current cursor position with JavaScript
-
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.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Insert text at the current cursor position with JavaScript’ is closed to new replies.