Skip to main content

$splitNode

function

Splits an ElementNode at the given child offset, returning [original, newCopy]. The original is mutated (children after offset moved out); the first element may be null per the return type contract. Recursively splits ancestors up to the nearest root or shadow root.

function $splitNode(node: ElementNode, offset: number): [ElementNode | null, ElementNode]

Import

import { $splitNode } from '@modular/sdk/editor';