From ba8e5d8bc22dc3a3b9739539d20b1cd724d7114a Mon Sep 17 00:00:00 2001 From: Trang Le Date: Mon, 9 Aug 2021 00:12:02 +0700 Subject: [PATCH] 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 No changeset as it's a doc update. --- docs/libraries/slate-react.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/libraries/slate-react.md b/docs/libraries/slate-react.md index 88bde11f5..485b580ea 100644 --- a/docs/libraries/slate-react.md +++ b/docs/libraries/slate-react.md @@ -168,7 +168,7 @@ Get the target range from a DOM `event`. 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.