Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/netzo/deps/@tiptap/react.ts>findParentNodeClosestToPos

Full-stack Deno framework for building business web apps like internal tools, dashboards, admin panels and automated workflows.
Go to Latest
function findParentNodeClosestToPos
import { findParentNodeClosestToPos } from "https://deno.land/x/netzo@0.5.106/deps/@tiptap/react.ts";

Finds the closest parent node to a resolved position that matches a predicate.

Examples

Example 1

findParentNodeClosestToPos($from, node => node.type.name === 'paragraph')

Parameters

The resolved position to search from

predicate: Predicate

The predicate to match

Returns

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

The closest parent node to the resolved position that matches the predicate