diff --git a/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js b/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js index 9fbb50c10c364f..97ef1c52b6dd97 100644 --- a/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js +++ b/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js @@ -6,7 +6,11 @@ import { castArray } from 'lodash'; /** * WordPress dependencies */ -import { getBlockType, serialize } from '@wordpress/blocks'; +import { + getBlockType, + serialize, + store as blocksStore, +} from '@wordpress/blocks'; import { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components'; import { useDispatch, useSelect } from '@wordpress/data'; import { moreVertical } from '@wordpress/icons'; @@ -75,8 +79,11 @@ export function BlockSettingsDropdown( { getNextBlockClientId, getSelectedBlockClientIds, getSettings, + getBlockAttributes, } = select( blockEditorStore ); + const { getActiveBlockVariation } = select( blocksStore ); + const parents = getBlockParents( firstBlockClientId ); const _firstParentClientId = parents[ parents.length - 1 ]; const parentBlockName = getBlockName( _firstParentClientId ); @@ -85,7 +92,11 @@ export function BlockSettingsDropdown( { firstParentClientId: _firstParentClientId, hasReducedUI: getSettings().hasReducedUI, onlyBlock: 1 === getBlockCount(), - parentBlockType: getBlockType( parentBlockName ), + parentBlockType: + getActiveBlockVariation( + parentBlockName, + getBlockAttributes( _firstParentClientId ) + ) || getBlockType( parentBlockName ), previousBlockClientId: getPreviousBlockClientId( firstBlockClientId ), nextBlockClientId: getNextBlockClientId( firstBlockClientId ),