Skip to content

Commit

Permalink
[RNMobile] Fix replacing empty paragraph in inner block (#20653)
Browse files Browse the repository at this point in the history
* Check if the replaceable block is a nested one
  • Loading branch information
dratwas committed Mar 12, 2020
1 parent 7dda442 commit 4dfb859
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/block-editor/src/components/inserter/menu.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ export default compose(
);

const count = getBlockCount();
if ( count === 1 ) {
// Check if there is a rootClientId because that means it is a nested replacable block and we don't want to clear/reset all blocks.
if ( count === 1 && ! ownProps.rootClientId ) {
// removing the last block is not possible with `removeBlock` action
// it always inserts a default block if the last of the blocks have been removed
clearSelectedBlock();
Expand Down

0 comments on commit 4dfb859

Please sign in to comment.