Skip to content

Commit

Permalink
Replace text block on paste if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Aug 22, 2017
1 parent a5f191a commit bb086d1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion blocks/editable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,13 @@ export default class Editable extends Component {
return;
}

this.splitContent( content );
const rootNode = this.editor.getBody();

if ( this.editor.dom.isEmpty( rootNode ) && this.props.onReplace ) {
this.props.onReplace( content );
} else {
this.splitContent( content );
}
}
}

Expand Down

0 comments on commit bb086d1

Please sign in to comment.