diff --git a/packages/edit-site/src/components/global-styles/border-panel.js b/packages/edit-site/src/components/global-styles/border-panel.js index 07e6254e4b34ee..9780ad2dfdd011 100644 --- a/packages/edit-site/src/components/global-styles/border-panel.js +++ b/packages/edit-site/src/components/global-styles/border-panel.js @@ -14,6 +14,7 @@ import { } from '@wordpress/components'; import { useCallback } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; +import { debounce } from '@wordpress/compose'; /** * Internal dependencies @@ -117,6 +118,9 @@ export default function BorderPanel( { name, variation = '' } ) { `${ prefix }border.radius`, name ); + + const debouncedSetBorderRadius = debounce( setBorderRadius, 5 ); + const hasBorderRadius = () => { const borderValues = userBorderStyles?.radius; if ( typeof borderValues === 'object' ) { @@ -205,7 +209,7 @@ export default function BorderPanel( { name, variation = '' } ) { { - setBorderRadius( value || undefined ); + debouncedSetBorderRadius( value || undefined ); } } />