From ef3acba0eed49666a0cdf4de8a8eb67b1164b5d2 Mon Sep 17 00:00:00 2001 From: im3dabasia Date: Mon, 16 Dec 2024 17:02:31 +0530 Subject: [PATCH] fix: use dropdown menu props social links block --- packages/block-library/src/social-links/edit.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/block-library/src/social-links/edit.js b/packages/block-library/src/social-links/edit.js index af39219af25a1..72fd265d629fb 100644 --- a/packages/block-library/src/social-links/edit.js +++ b/packages/block-library/src/social-links/edit.js @@ -31,6 +31,11 @@ import { __ } from '@wordpress/i18n'; import { check } from '@wordpress/icons'; import { useSelect } from '@wordpress/data'; +/** + * Internal dependencies + */ +import { useToolsPanelDropdownMenuProps } from '../utils/hooks'; + const sizeOptions = [ { name: __( 'Small' ), value: 'has-small-icon-size' }, { name: __( 'Normal' ), value: 'has-normal-icon-size' }, @@ -69,6 +74,8 @@ export function SocialLinksEdit( props ) { const logosOnly = attributes.className?.includes( 'is-style-logos-only' ); + const dropdownMenuProps = useToolsPanelDropdownMenuProps(); + // Remove icon background color when logos only style is selected or // restore it when any other style is selected. const backgroundBackupRef = useRef( {} ); @@ -207,6 +214,7 @@ export function SocialLinksEdit( props ) { showLabels: false, } ); } } + dropdownMenuProps={ dropdownMenuProps } >