From 6ae0875e52d742f92e842edbbfb60f2cbd5f0e6d Mon Sep 17 00:00:00 2001 From: Blake Thomson Date: Sun, 15 Apr 2018 21:05:13 -0700 Subject: [PATCH] Improve keyboard docs (#2057) --- docs/docs/modules/keyboard.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/docs/modules/keyboard.md b/docs/docs/modules/keyboard.md index df7eccde51..c708ccea99 100644 --- a/docs/docs/modules/keyboard.md +++ b/docs/docs/modules/keyboard.md @@ -161,6 +161,8 @@ Some bindings are essential to preventing dangerous browser defaults, such as th Adding a binding with `quill.keyboard.addBinding` will not run before Quill's because the defaults bindings will have been added by that point. +Pass the `bindings` option to the keyboard module, as an object of handler names to binding config objects. Each binding config must contain `key` and `handler` options, and may optionally include any of the `context` options. + ```javascript var bindings = { // This will overwrite the default binding also named 'tab' @@ -183,9 +185,7 @@ var bindings = { list: { key: 'backspace', - context: { - format: ['list'] - }, + format: ['list'], handler: function(range, context) { if (context.offset === 0) { // When backspace on the first character of a list,