1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-22 23:12:52 +02:00

Adds an example to the docs for Transforms.select (#4507)

This commit is contained in:
Doug Reeder
2021-09-10 20:49:13 -04:00
committed by GitHub
parent 269e59c93a
commit 8b85aeb205

View File

@@ -115,6 +115,15 @@ Options: `{edge?: 'anchor' | 'focus' | 'start' | 'end'}`
Set the selection to a new value specified by `target`. When a selection already exists, this method is just a proxy for `setSelection` and will update the existing value. Set the selection to a new value specified by `target`. When a selection already exists, this method is just a proxy for `setSelection` and will update the existing value.
For example, to set the selection to the entire contents of the editor:
```javascript
Transforms.select(editor, {
anchor: Editor.start(editor, []),
focus: Editor.end(editor, []),
})
```
#### `Transforms.deselect(editor: Editor)` #### `Transforms.deselect(editor: Editor)`
Unset the selection. Unset the selection.