Insertion

inserter:insert#

Emitted after the inserter inserts content. Only fires when at least one node or block was inserted.

Type: signal.

Payload:

  • nodes — array of inserted DOM nodes
  • blocks — array of mounted block instances for the inserted content

Example:

app.on('inserter:insert', ({ blocks, nodes }) => {
  blocks.forEach((block) => highlightNewBlock(block.getEl()));
  console.log(`Inserted ${blocks.length} block(s), ${nodes.length} node(s)`);
});