Skip to main content

$getSlotFrame

function

Returns the slot value (the "slot frame") whose isolated subtree contains `node`, or `node` itself when it is a slot value, or null when the node is not inside any slot. The walk follows `getParent()` and naturally stops at a slot value because a slotted node's `__parent` is null. Non-slot trees have `__slotHost === null` everywhere, so this always returns null there. Selection-driven exporters use this to find the isolated subtree a RangeSelection lives in (a selection inside a slot never contains the host, so a root-children walk alone would miss it).

function $getSlotFrame(node: LexicalNode): LexicalNode | null

Import

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