Skip to content

Seeking an Efficient Way to Find Node Children in Plate.js #3123

Answered by 12joan
SID9-HoneyBee asked this question in Q&A
Discussion options

You must be logged in to vote

Slate provides a number of utilities for working with offsets. For example, getPointAfter(editor, editor.selection, { unit: 'character', distance: 1 }) returns a Point object (see Slate's docs) corresponding to one character after the end of the selection, or undefined if no such point exists. You can then pass this point to getNodeLeaf to get the data for the text node at that point.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SID9-HoneyBee
Comment options

Answer selected by SID9-HoneyBee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants