1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-27 17:09:53 +02:00

Clarify instructions for plugin preventing default behavior (#740)

This commit is contained in:
Anuj
2017-04-21 21:17:04 -07:00
committed by Ian Storm Taylor
parent eb03bd8ec4
commit 51f1a2f9d9

View File

@@ -63,7 +63,7 @@ Each event handler can choose to return a new `state` object, in which case the
This handler is called right before a string of text is inserted into the `contenteditable` element.
Make sure to `event.preventDefault()` if you do not want the default insertion behavior to occur! If no other plugin handles this event, it will be handled by the [Core plugin](./core.md).
Make sure to `event.preventDefault()` (and return `state`) if you do not want the default insertion behavior to occur! If no other plugin handles this event, it will be handled by the [Core plugin](./core.md).
### `onBlur`
`Function onBlur(event: Event, data: Object, state: State, editor: Editor) => State || Void`
@@ -161,7 +161,7 @@ The `isModAlt` boolean is `true` if the `control` key was pressed on Windows or
The `isLine` and `isWord` booleans represent whether the "line modifier" or "word modifier" hotkeys are pressed when deleteing or moving the cursor. For example, on a Mac `option + right` moves the cursor to the right one word at a time.
Make sure to `event.preventDefault()` if you do not want the default insertion behavior to occur! If no other plugin handles this event, it will be handled by the [Core plugin](./core.md).
Make sure to `event.preventDefault()` (and return `state`) if you do not want the default insertion behavior to occur! If no other plugin handles this event, it will be handled by the [Core plugin](./core.md).
### `onPaste`
`Function onPaste(event: Event, data: Object, state: State, editor: Editor) => State || Void`