File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
packages/block-editor/src/components/block-toolbar Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -100,9 +100,11 @@ const BlockActionsMenu = ( {
100100 } = getMoversSetup ( isStackedHorizontally , moversOptions ) ;
101101
102102 // Check if selected block is Groupable and/or Ungroupable.
103- const convertToGroupButtonProps = useConvertToGroupButtonProps ( [
104- selectedBlockClientId ,
105- ] ) ;
103+ const convertToGroupButtonProps = useConvertToGroupButtonProps (
104+ // `selectedBlockClientId` can be undefined in some cases where this
105+ // component gets re-rendered right after the block is removed.
106+ selectedBlockClientId ? [ selectedBlockClientId ] : [ ]
107+ ) ;
106108 const { isGroupable, isUngroupable } = convertToGroupButtonProps ;
107109 const showConvertToGroupButton =
108110 ( isGroupable || isUngroupable ) && canRemove ;
You can’t perform that action at this time.
0 commit comments