diff --git a/core-blocks/spacer/index.js b/core-blocks/spacer/index.js
index 055fba1f1dac10..418317913feb1b 100644
--- a/core-blocks/spacer/index.js
+++ b/core-blocks/spacer/index.js
@@ -9,7 +9,7 @@ import ResizableBox from 're-resizable';
import { Fragment } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { InspectorControls } from '@wordpress/editor';
-import { BaseControl, PanelBody } from '@wordpress/components';
+import { BaseControl, PanelBody, withInstanceId } from '@wordpress/components';
/**
* Internal dependencies
@@ -34,61 +34,64 @@ export const settings = {
},
},
- edit( { attributes, setAttributes, toggleSelection } ) {
- const { height } = attributes;
+ edit: withInstanceId(
+ ( { attributes, setAttributes, toggleSelection, instanceId } ) => {
+ const { height } = attributes;
+ const id = `block-spacer-height-input-${ instanceId }`;
- return (
-