From f56f28a8facd4eac62f67c4dc699a8129cece3dd Mon Sep 17 00:00:00 2001 From: kyrisu Date: Mon, 22 Oct 2018 19:19:55 +0100 Subject: [PATCH] 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` --- docs/guides/commands-and-queries.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/commands-and-queries.md b/docs/guides/commands-and-queries.md index b8597c451..8ae07ae8d 100644 --- a/docs/guides/commands-and-queries.md +++ b/docs/guides/commands-and-queries.md @@ -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() }