diff --git a/packages/block-library/src/button/edit.js b/packages/block-library/src/button/edit.js index 520da26ef9671..d00e522f5a5d2 100644 --- a/packages/block-library/src/button/edit.js +++ b/packages/block-library/src/button/edit.js @@ -9,6 +9,7 @@ import clsx from 'clsx'; import { NEW_TAB_TARGET, NOFOLLOW_REL } from './constants'; import { getUpdatedLinkAttributes } from './get-updated-link-attributes'; import removeAnchorTag from '../utils/remove-anchor-tag'; +import { useToolsPanelDropdownMenuProps } from '../utils/hooks'; /** * WordPress dependencies @@ -115,10 +116,13 @@ function useEnter( props ) { } function WidthPanel( { selectedWidth, setAttributes } ) { + const dropdownMenuProps = useToolsPanelDropdownMenuProps(); + return ( setAttributes( { width: undefined } ) } + dropdownMenuProps={ dropdownMenuProps } > { setAttributes( { width: undefined } ); } } + dropdownMenuProps={ dropdownMenuProps } > width !== undefined } diff --git a/packages/block-library/src/columns/edit.js b/packages/block-library/src/columns/edit.js index d79dfe4fc94a4..cad79c356fe03 100644 --- a/packages/block-library/src/columns/edit.js +++ b/packages/block-library/src/columns/edit.js @@ -40,6 +40,7 @@ import { getRedistributedColumnWidths, toWidthPrecision, } from './utils'; +import { useToolsPanelDropdownMenuProps } from '../utils/hooks'; const DEFAULT_BLOCK = { name: 'core/column', @@ -145,6 +146,8 @@ function ColumnInspectorControls( { replaceInnerBlocks( clientId, innerBlocks ); } + const dropdownMenuProps = useToolsPanelDropdownMenuProps(); + return ( { canInsertColumnBlock && ( showMoreOnNewLine !== true } diff --git a/packages/block-library/src/social-link/edit.js b/packages/block-library/src/social-link/edit.js index 43fb305d52ffa..4cd24505fd552 100644 --- a/packages/block-library/src/social-link/edit.js +++ b/packages/block-library/src/social-link/edit.js @@ -36,6 +36,7 @@ import { keyboardReturn } from '@wordpress/icons'; * Internal dependencies */ import { getIconBySite, getNameBySite } from './social-list'; +import { useToolsPanelDropdownMenuProps } from '../utils/hooks'; const SocialLinkURLPopover = ( { url, @@ -109,6 +110,7 @@ const SocialLinkEdit = ( { clientId, } ) => { const { url, service, label = '', rel } = attributes; + const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const { showLabels, iconColor, @@ -200,6 +202,7 @@ const SocialLinkEdit = ( { resetAll={ () => { setAttributes( { label: undefined } ); } } + dropdownMenuProps={ dropdownMenuProps } > hasFixedLayout !== true } diff --git a/packages/block-library/src/tag-cloud/edit.js b/packages/block-library/src/tag-cloud/edit.js index b41e47faec369..7e544d2474f04 100644 --- a/packages/block-library/src/tag-cloud/edit.js +++ b/packages/block-library/src/tag-cloud/edit.js @@ -24,6 +24,11 @@ import { import ServerSideRender from '@wordpress/server-side-render'; import { store as coreStore } from '@wordpress/core-data'; +/** + * Internal dependencies + */ +import { useToolsPanelDropdownMenuProps } from '../utils/hooks'; + /** * Minimum number of tags a user can show using this block. * @@ -51,6 +56,7 @@ function TagCloudEdit( { attributes, setAttributes } ) { } = attributes; const [ availableUnits ] = useSettings( 'spacing.units' ); + const dropdownMenuProps = useToolsPanelDropdownMenuProps(); // The `pt` unit is used as the default value and is therefore // always considered an available unit. @@ -129,6 +135,7 @@ function TagCloudEdit( { attributes, setAttributes } ) { largestFontSize: '22pt', } ); } } + dropdownMenuProps={ dropdownMenuProps } > taxonomy !== 'post_tag' }