Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The dimensions UI is displayed when the does not support Dimensions. #53092

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

shimotmk
Copy link
Contributor

fix #51723

What?

Why?

Fixed a bug that caused the Dimensions panel to appear when an HTML block or shortcode block was enclosed in a group block.

How?

Testing Instructions

  1. Paste the code below into the block editor.
<!-- wp:group {"layout":{"type":"flex","flexWrap":"nowrap"}} -->
<div class="wp-block-group"><!-- wp:buttons -->
<div class="wp-block-buttons"><!-- wp:button -->
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button">Button</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons -->

<!-- wp:html -->
Custom HTML
<!-- /wp:html --></div>
<!-- /wp:group -->
  1. trunk branch: Click on the custom HTML block and the Dimension panel is displayed.

  2. The values set in the Dimension panel are not saved and have no effect in the front end.

  3. Switch to this branch and check that the Dimension panel is not visible in HTML blocks etc.

Testing Instructions for Keyboard

Screenshots or screencast

dimension.mp4

@tellthemachines
Copy link
Contributor

Thanks for the PR! It's on my review list but I'm unlikely to get around to it until sometime next week 😅

@ramonjd ramonjd added [Type] Bug An existing feature does not function as intended [Block] HTML Affects the the HTML Block [Feature] Layout Layout block support, its UI controls, and style output. labels Jul 31, 2023
Copy link
Member

@ramonjd ramonjd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is working well for me. Nice fix!

I can't imagine any regressions given that we're checking for style block support in the style hook, but I'd feel better about a second review!

Copy link
Contributor

@andrewserong andrewserong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix @shimotmk!

This is testing well for me, too. At first glance, I was wondering if the check could be further down the chain in useHasChildLayout, but on second thoughts I think the approach in this PR is the right one, as it's a nice catch all for all the style components — at least one style support has to be opted into before we render any of those controls.

This LGTM, too! ✨

@ramonjd ramonjd merged commit 1052456 into WordPress:trunk Jul 31, 2023
@github-actions github-actions bot added this to the Gutenberg 16.4 milestone Jul 31, 2023
@shimotmk shimotmk deleted the fix/51723 branch July 31, 2023 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] HTML Affects the the HTML Block [Feature] Layout Layout block support, its UI controls, and style output. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTML block: The dimensions UI is displayed when the does not support Dimensions.
4 participants