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>findParentNode

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

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

Examples

Example 1

findParentNode(node => node.type.name === 'paragraph')

Parameters

predicate: Predicate

The predicate to match

Returns

(selection: Selection) => { pos: number; start: number; depth: number; node: import("https://esm.sh/v135/prosemirror-model@1.21.1/X-ZS9yZWFjdCxyZWFjdC1kb20scmVhY3QvanN4LXJ1bnRpbWU/dist/index.d.ts").Node; } | undefined

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