Skip to main content

findParentNode

@blockslides/core


@blockslides/core / findParentNode

Function: findParentNode()

findParentNode(predicate): (selection) => { pos: number; start: number; depth: number; node: Node; } | undefined

Defined in: blockslides/packages/core/src/helpers/findParentNode.ts:14

Finds the closest parent node to the current selection that matches a predicate.

Parameters

predicate

Predicate

The predicate to match

Returns

A command that finds the closest parent node to the current selection that matches the predicate

(selection): { pos: number; start: number; depth: number; node: Node; } | undefined

Parameters

selection

Selection

Returns

{ pos: number; start: number; depth: number; node: Node; } | undefined

Example