1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-21 14:41:23 +02:00

feat(docs): mention third parameter to toSlateRange method in the docs (#4416)

* Add third parameter to `toSlateRange` method

The `toSlateRange` method accepts an optional third parameter that is an object with property `exactMatch` and value is a boolean.

Example of this implementation can be found at the `Editable` component of `slate-react`, inside the custom `onDOMSelectionChange`.

* toSlateRange third param is optional

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>

No changeset as it's a doc update.
This commit is contained in:
Trang Le
2021-08-09 00:12:02 +07:00
committed by GitHub
parent e65eeb2939
commit ba8e5d8bc2

View File

@@ -168,7 +168,7 @@ Get the target range from a DOM `event`.
Find a Slate point from a DOM selection's `domNode` and `domOffset`. Find a Slate point from a DOM selection's `domNode` and `domOffset`.
### `toSlateRange(editor: ReactEditor, domRange: DOMRange | DOMStaticRange | DOMSelection)` ### `toSlateRange(editor: ReactEditor, domRange: DOMRange | DOMStaticRange | DOMSelection, options?: { exactMatch?: boolean } = {})`
Find a Slate range from a DOM range or selection. Find a Slate range from a DOM range or selection.