1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-30 10:29:48 +02:00

Adds an example using SlateNode.common() with the editor selection (#5176)

This commit is contained in:
Doug Reeder
2022-11-01 08:13:15 -04:00
committed by GitHub
parent d868c930f6
commit 469bec3d04
2 changed files with 27 additions and 2 deletions

View File

@@ -31,7 +31,9 @@ Options: `{reverse?: boolean}`
#### `Node.common(root: Node, path: Path, another: Path) => NodeEntry`
Get an entry for the common ancestor node of two paths.
Get an entry for the common ancestor node of two paths. It might be a Text node, an Element, or the Editor itself.
For the common block ancestor, see [Editor Selection](https://docs.slatejs.org/concepts/03-locations#selection)
#### `Node.descendant(root: Node, path: Path) => Descendant`