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

HTML block: The dimensions UI is displayed when the does not support Dimensions. #51723

Closed
shimotmk opened this issue Jun 21, 2023 · 10 comments · Fixed by #53092
Closed

HTML block: The dimensions UI is displayed when the does not support Dimensions. #51723

shimotmk opened this issue Jun 21, 2023 · 10 comments · Fixed by #53092
Assignees
Labels
[Block] HTML Affects the the HTML Block [Feature] Block settings menu The block settings screen [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Feature] Layout Layout block support, its UI controls, and style output. [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@shimotmk
Copy link
Contributor

Description

The UI is displayed in a block that does not support Dimension.

Step-by-step reproduction 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. 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.

Screenshots, screen recording, code snippet

dimension.mp4

Environment info

WordPress 6.2.2
Gutenberg 16.0.0
Twenty Twenty-Three 1.1

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@kathrynwp kathrynwp added [Type] Bug An existing feature does not function as intended [Feature] Block settings menu The block settings screen [Block] Buttons Affects the Buttons Block Needs Testing Needs further testing to be confirmed. labels Jun 26, 2023
@ndiego ndiego added [Block] HTML Affects the the HTML Block and removed Needs Testing Needs further testing to be confirmed. [Block] Buttons Affects the Buttons Block labels Jun 27, 2023
@ndiego ndiego changed the title The UI is displayed in a block that does not support Dimension. HTML block: The dimensions UI is displayed when the does not support Dimensions. Jun 27, 2023
@ndiego
Copy link
Member

ndiego commented Jun 27, 2023

Thanks for reporting @shimotmk. I have confirmed and am going to add this to the 6.3 Project Board.

@Mamaduka
Copy link
Member

I believe this is a new feature and not a bug. See #45364 and #44467.

The dev note and user documentation are still pending.

@ndiego
Copy link
Member

ndiego commented Jul 3, 2023

I believe this is a new feature and not a bug. See #45364 and #44467.

Yeah, this is true, but the HTML block us unique in that these settings will not work with it. The frontend is just what's placed in the HTML block, there is no wrapper.

@ramonjd
Copy link
Member

ramonjd commented Jul 6, 2023

I'm thinking something like "layout": false," in html/block.json should disable this. It should, but it doesn't 😄 I tried.

@shimotmk
Copy link
Contributor Author

shimotmk commented Jul 6, 2023

This bug applies not only to HTML blocks Shortcode or Classic or It's happening in a custom block.

@ramonjd
Copy link
Member

ramonjd commented Jul 6, 2023

I did play around with this yesterday, by adding a specific property to the block.json, e.g.,

"layout": {
    "allowSizing": false,
}

It needs a further check in the dimensions hook (packages/block-editor/src/hooks/dimensions.js) and component (packages/block-editor/src/components/global-styles/dimensions-panel.js). I'm not sure if this is the right approach.

It's not easy to grok for me, due to the semantic contradiction though, which flows through to the supports components. "allowSizingOnChildren": true is a layout flag, but it's controlling something in the dimensions panel.

@tellthemachines
Copy link
Contributor

The dev note and user documentation are still pending.

The dev note was published here during the 6.2 cycle. I'm not sure what user documentation would be required or where it would have been published.

@tellthemachines
Copy link
Contributor

Regarding the actual problem 😄 custom HTML is a bit of an edge case, in that its editor presentation doesn't match the front end and it doesn't necessarily have a single container.

I guess this will require some sort of off-switch for the child layout controls, but it's not fully clear where they should reside. The display of these controls is decided by the parent block (for all of its children) inside the layout support, thought the controls themselves display as part of the dimensions panel.

This might also be impacted by the changes in #49459.

@tellthemachines
Copy link
Contributor

I'm going to remove this from the 6.3 board because it's not a regression from this release, but an edge case tied to an existing feature.

@tellthemachines tellthemachines added [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Feature] Layout Layout block support, its UI controls, and style output. labels Jul 21, 2023
shimotmk added a commit to shimotmk/gutenberg that referenced this issue Jul 28, 2023
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jul 28, 2023
@shimotmk
Copy link
Contributor Author

It looks like this bug can be fixed!
Could someone please take a look at this PR?
#53092

ramonjd pushed a commit that referenced this issue Jul 31, 2023
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] Block settings menu The block settings screen [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Feature] Layout Layout block support, its UI controls, and style output. [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants