diff --git a/blocks/editable/index.js b/blocks/editable/index.js index 497bfa51305b86..a225c4162b2db7 100644 --- a/blocks/editable/index.js +++ b/blocks/editable/index.js @@ -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 @@ -586,7 +585,6 @@ export default class Editable extends Component { if ( event.shiftKey || ! this.props.onSplit ) { this.editor.execCommand( 'InsertLineBreak', false, event ); } else { - event.stopImmediatePropagation(); this.splitContent(); } } diff --git a/editor/components/block-list/block.js b/editor/components/block-list/block.js index 02775e35828572..7bc2f126e03cd3 100644 --- a/editor/components/block-list/block.js +++ b/editor/components/block-list/block.js @@ -224,12 +224,9 @@ export class BlockListBlock extends Component { } maybeStartTyping() { - // We do not want to dispatch start typing if... - // - State value already reflects that we're typing (dispatch noise) - // - The current block is not selected (e.g. after a split occurs, - // we'll still receive the keyDown event, but the focus has since - // shifted to the newly created block) - if ( ! this.props.isTyping && this.props.isSelected ) { + // We do not want to dispatch start typing if state value already reflects + // that we're typing (dispatch noise) + if ( ! this.props.isTyping ) { this.props.onStartTyping(); } } @@ -267,6 +264,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 ) { @@ -311,6 +312,9 @@ export class BlockListBlock extends Component { createBlock( 'core/paragraph' ), ], this.props.order + 1 ); } + + // Pressing enter should trigger typing mode after the content has split + this.maybeStartTyping(); break; case UP: @@ -336,6 +340,9 @@ export class BlockListBlock extends Component { } } } + + // Pressing backspace should trigger typing mode + this.maybeStartTyping(); break; case ESCAPE: