Fixes #846 Backspace removes empty blocks (#854)

* Fixes backspace remove empty block

* rename data to event
This commit is contained in:
Damien Duhamel 2017-11-30 18:09:13 +01:00 committed by Shawn Erquhart
parent 28924eeea5
commit 2e7e66dc29

View File

@ -54,8 +54,8 @@ const BreakToDefaultBlockOpts = {
export const BreakToDefaultBlockConfigured = BreakToDefaultBlock(BreakToDefaultBlockOpts);
const BackspaceCloseBlock = (options = {}) => ({
onKeyDown(e, data, change) {
if (data.key != 'backspace') return;
onKeyDown(event, change) {
if (event.key !== 'Backspace') return;
const { defaultBlock = 'paragraph', ignoreIn, onlyIn } = options;
const { startBlock } = change.value;