Skip to content

Commit

Permalink
Fix TinyMCE error on double enter split
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Apr 12, 2018
1 parent 6662c36 commit 6ab8eea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions blocks/rich-text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,10 @@ export class RichText extends Component {
if ( event.shiftKey || ! this.props.onSplit ) {
this.editor.execCommand( 'InsertLineBreak', false, event );
} else {
// Splitting the content might destroy the editor, so it's
// important that we stop other handlers (e.g. ones
// registered by TinyMCE) from also handling this event.
event.stopImmediatePropagation();
this.splitContent();
}
}
Expand Down

0 comments on commit 6ab8eea

Please sign in to comment.