Skip to main content

$hasAncestor

function

Returns true if targetNode is an ancestor of child by walking up the parent chain.

function $hasAncestor(child: LexicalNode, targetNode: LexicalNode): boolean

Import

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