This PR addresses this by passing the Draftail keyBindingFn as an extra, final plugin to the plugin Editor component instead. This is done so that:
the existing keyBindingFn can continue to prevent Draft responding overly sensitively to keyboard shortcuts (otherwise we could simply use the defaultKeyBindings option of the plugins editor) by returning undefined
plugins can add additional key bindings
I haven't added this to the documentation yet - as it's just a fix, I'm not sure where it should go, but happy to add if you think it needs a mention somewhere. Tested in latest Chrome and Firefox on Ubuntu.
Currently, as described in https://github.com/springload/draftail/issues/246, Draftail does not call plugin
keyBindingFn
s, preventing custom keyboard shortcuts from being used.This PR addresses this by passing the Draftail
keyBindingFn
as an extra, final plugin to the pluginEditor
component instead. This is done so that:keyBindingFn
can continue to prevent Draft responding overly sensitively to keyboard shortcuts (otherwise we could simply use thedefaultKeyBindings
option of the plugins editor) by returning undefinedI haven't added this to the documentation yet - as it's just a fix, I'm not sure where it should go, but happy to add if you think it needs a mention somewhere. Tested in latest Chrome and Firefox on Ubuntu.