mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-28 17:39:57 +02:00
Clarify instructions for plugin preventing default behavior (#740)
This commit is contained in:
@@ -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.
|
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`
|
### `onBlur`
|
||||||
`Function onBlur(event: Event, data: Object, state: State, editor: Editor) => State || Void`
|
`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.
|
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`
|
### `onPaste`
|
||||||
`Function onPaste(event: Event, data: Object, state: State, editor: Editor) => State || Void`
|
`Function onPaste(event: Event, data: Object, state: State, editor: Editor) => State || Void`
|
||||||
|
Reference in New Issue
Block a user