Skip to content

Commit

Permalink
[RNMobile] Disable regular blocks conversion if the reusable block is…
Browse files Browse the repository at this point in the history
… empty (#50475)

* Disable regular blocks conversion if the reusable block is empty

Deleted blocks doesn't have inner blocks, so we can rely on inner block count to determine if the conversion can happen.

* Update react-native-editor changelog
  • Loading branch information
fluiddot committed May 10, 2023
1 parent 758bc81 commit 7e4fd67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,9 @@ const BlockActionsMenu = ( {
canDuplicate && allOptions.cutButton,
canDuplicate && isPasteEnabled && allOptions.pasteButton,
canDuplicate && allOptions.duplicateButton,
isReusableBlockType && allOptions.convertToRegularBlocks,
isReusableBlockType &&
innerBlockCount > 0 &&
allOptions.convertToRegularBlocks,
! isLocked && allOptions.delete,
].filter( Boolean );

Expand Down
1 change: 1 addition & 0 deletions packages/react-native-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ For each user feature we should also add a importance categorization label to i
-->

## Unreleased
- [*] Fix crash when trying to convert to regular blocks an undefined/deleted reusable block [#50475]

## 1.94.0
- [*] Split pasted content between title and body. [#37169]
Expand Down

1 comment on commit 7e4fd67

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 7e4fd67.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4935005619
📝 Reported issues:

Please sign in to comment.