Spacer Block Height Customization Not Applied in Gutenberg Editor

Created on 5 November 2024, 8 months ago

Problem/Motivation

When adding a Spacer block in the Gutenberg editor and attempting to customize the height using the control in the sidebar, the height setting is not applied, resulting in the spacer block not rendering with the expected height.

Steps to reproduce

  1. Open a page or post in the Drupal 10 Gutenberg editor.
  2. Add a "Spacer" block.
  3. In the block settings sidebar, adjust the height using the available control.

Proposed resolution

The height adjustment made via the sidebar control should be applied to the Spacer block, and the block should render with the custom height.

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇵🇰Pakistan ahmad aziz

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ahmad aziz
  • 🇳🇴Norway vegardjo

    Very similar to https://github.com/WordPress/gutenberg/issues/68817#issuecomment-2606269320, even though they speak of setting the value to 0, not whatever.

    The console message is:

    Block validation: Block validation failed for `core/spacer` ({name: 'core/spacer', icon: {…}, keywords: Array(0), attributes: {…}, providesContext: {…}, …}).
    
    Content generated by `save` function:
    
    <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
    
    Content retrieved from post body:
    
    <div aria-hidden="true" class="wp-block-spacer"></div>
    

    The bug is not present in an updated Wordpress install, so I assume this has been fixed upstream and that the fix will eventually find it's way here.

Production build 0.71.5 2024