Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/docs/modules/keyboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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,
Expand Down