diff --git a/tinymce-single/tinymce/block.css b/tinymce-single/tinymce/block.css index 82f8e5fba7262..5cbafc2629e39 100644 --- a/tinymce-single/tinymce/block.css +++ b/tinymce-single/tinymce/block.css @@ -385,4 +385,5 @@ div.mce-inline-toolbar-grp.block-toolbar > div.mce-stack-layout { content: attr(data-wp-placeholder); position: absolute; opacity: 0.5; + pointer-events: none; } diff --git a/tinymce-single/tinymce/block.js b/tinymce-single/tinymce/block.js index 8badd89e3a1f5..a9ebcd2ab0b1d 100644 --- a/tinymce-single/tinymce/block.js +++ b/tinymce-single/tinymce/block.js @@ -207,12 +207,14 @@ editor.on( 'keyup', function( event ) { if ( event.keyCode === tinymce.util.VK.BACKSPACE ) { - var $empty = editor.$( editor.selection.getNode() ).find( ':empty' ); + var block = getSelectedBlock(); - $empty.append( '
' ); + if ( ! block.textContent ) { + var p = editor.$( '


' ); - if ( $empty.length ) { - editor.selection.setCursorLocation( $empty[0], 0 ); + editor.$( block ).before( p ); + editor.selection.setCursorLocation( p[0], 0 ); + editor.$( block ).remove(); } } } );