1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-07-31 04:20:26 +02:00

update onSelect docs with note about onSelectionChange, closes #467

This commit is contained in:
Ian Storm Taylor
2016-12-01 09:09:27 -08:00
parent dc78406424
commit e37d1b20f3

View File

@@ -183,12 +183,14 @@ If no other plugin handles this event, it will be handled by the [Core plugin](.
### `onSelect`
`Function onSelect(event: Event, data: Object, state: State, editor: Editor => State || Void`
This handler is called whenever the native selection changes.
This handler is called whenever the native DOM selection changes.
The `data` object contains a State [`Selection`](../models/selection.md) object representing the new selection.
If no other plugin handles this event, it will be handled by the [Core plugin](./core.md).
_Note: This is **not** Slate's internal selection representation (although it mirrors it). If you want to get notified when Slate's selection changes, use the [`onSelectionChange`](../components/editor.md#onselectionchange) property of the `<Editor>`. This handler is instead meant to give you lower-level access to the DOM selection handling._
## Other Properties