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

Can't add description to ToolsPanel as per readme example #42543

Closed
tellthemachines opened this issue Jul 20, 2022 · 1 comment
Closed

Can't add description to ToolsPanel as per readme example #42543

tellthemachines opened this issue Jul 20, 2022 · 1 comment
Assignees
Labels
[Package] Components /packages/components [Type] Bug An existing feature does not function as intended

Comments

@tellthemachines
Copy link
Contributor

tellthemachines commented Jul 20, 2022

Description

When adding a description inside the ToolsPanel component, using the syntax provided in the component readme example, the layout appears broken:

Screen Shot 2022-07-20 at 11 54 31 am

ToolsPanel is defining a 2 col grid style, with ToolsPanelItems styled to span both columns, but any other element inserted in the ToolsPanel will automatically be assigned to a single column. I came across this while working on #42309, in which I'm also using a Flex component to wrap a couple of ToolsPanelItems so they stay on the same line. That works as long as Flex is the only child of ToolsPanel; once I add the paragraph the layout breaks as shown above. But it still looks broken even if the other children span both cols:

Screen Shot 2022-07-20 at 11 47 35 am

Ideally, the ToolsPanel should provide a way to render a semantic description for the controls. Could we perhaps leverage fieldset and legend here?

But the styling issue should also be looked into: do we really need it to be a grid if its contents always span both columns?

Step-by-step reproduction instructions

  1. Add a paragraph directly inside a ToolsPanel component with one or more ToolsPanelItems.
  2. Verify that layout appears broken.

Screenshots, screen recording, code snippet

No response

Environment info

No response

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

@tellthemachines tellthemachines added [Type] Bug An existing feature does not function as intended [Package] Components /packages/components labels Jul 20, 2022
@aaronrobertshaw aaronrobertshaw self-assigned this Jul 20, 2022
@aaronrobertshaw
Copy link
Contributor

I believe the readme issue was addressed in #42615, so closing this.

The two-column grid was desired to allow layouts such as that in the typography panel as the most common case. The ToolsPanel design is being revisited so any changes to the default layout would be wrapped up in that if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants