1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-16 04:04:06 +02:00

Fixed KeyDown handler signature in code snippet (#2294)

The paragraph mentioned handle signature being `event, change, next` but the snippet had a signature with `event, change, editor`
This commit is contained in:
kyrisu
2018-10-22 19:19:55 +01:00
committed by Ian Storm Taylor
parent 4c52f7ceff
commit f56f28a8fa

View File

@@ -88,7 +88,7 @@ When you decide you want to make a change to the Slate value, you're almost alwa
The first place, is inside a Slate-controlled event handler, like `onKeyDown` or `onPaste`. These handlers take a signature of `event, change, next`. That `change` argument is a [`Change`](../reference/slate/change.md) object that you can manipulate. For example...
```js
function onKeyDown(event, change, editor) {
function onKeyDown(event, change, next) {
if (event.key == 'Enter') {
change.splitBlock()
}