Skip to content

Commit

Permalink
Trigger typing mode when BACKSPACE is pressed
Browse files Browse the repository at this point in the history
  • Loading branch information
noisysocks committed Jan 15, 2018
1 parent 394c89b commit a6b45ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion blocks/editable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,6 @@ export default class Editable extends Component {
}

event.preventDefault();
event.stopImmediatePropagation();
}

// If we click shift+Enter on inline Editables, we avoid creating two contenteditables
Expand Down
7 changes: 7 additions & 0 deletions editor/components/block-list/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ export class BlockListBlock extends Component {
} else {
onMerge( previousBlock, block );
}

// Manually trigger typing mode, since merging will remove this block and
// cause onKeyDown to not fire
this.maybeStartTyping();
}

insertBlocksAfter( blocks ) {
Expand Down Expand Up @@ -335,6 +339,9 @@ export class BlockListBlock extends Component {
}
}
}

// Pressing backspace should trigger typing mode
this.maybeStartTyping();
break;

case ESCAPE:
Expand Down

0 comments on commit a6b45ad

Please sign in to comment.