Open MadtownLems opened 4 hours ago
Hello,
Thank you for reporting this bug.
I have verified that the issue occurs with grow and fit, but it works fine with fixed width. I’ll now investigate possible solutions.
Thanks!
I’ve identified the problem—it originates from the useEffect running on load and updating attributes:
if ( isFlexLayout && ( selfStretch === 'fill' || selfStretch === 'fit' )) {
if ( inheritedOrientation === 'horizontal' ) {
setAttributes( {
width: undefined,
} );
} else {
setAttributes( {
height: undefined,
} );
}
}
I’ll investigate further to determine whether this can be removed or if additional checks are needed.
I’ve identified the problem—it originates from the useEffect running on load and updating attributes:
if ( isFlexLayout && ( selfStretch === 'fill' || selfStretch === 'fit' )) {
if ( inheritedOrientation === 'horizontal' ) { setAttributes( { width: undefined, } ); } else { setAttributes( { height: undefined, } ); } } I’ll investigate further to determine whether this can be removed or if additional checks are needed.
I believe adding a check && width !== undefined
resolves the issue. I’ll proceed with opening a PR to address this.
Description
When you leave the Post Editor of content that contains a Spacer Block set to either Grow (previously Fill) or Fit, the browser will warn you about losing unsaved changes, even if you haven't changed anything. The issue does not impact Spacer Blocks that have a Fixed height.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
WordPress 6.6.2 and WordPress 6.7. Theme: Twenty Twenty Four (and others). No Gutenberg plugin.
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.