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

Consider a way to allow/disallow alignment for InnerBlocks #27179

Closed
jordesign opened this issue Nov 22, 2020 · 5 comments
Closed

Consider a way to allow/disallow alignment for InnerBlocks #27179

jordesign opened this issue Nov 22, 2020 · 5 comments
Labels
[Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P

Comments

@jordesign
Copy link
Contributor

Problem

Currently, when a block is allowed to be inserted as an InnerBlock it will default to having the same alignment options as normal. In some instances - this isn't appropriate.

Example. In enabling the 'Social Links' block to be included in the Navigation block - the alignment options were still available despite the fact contextually the social links should effectively appear inline with the other menu items. Selecting an alignment for the Social LInks block can break the appearance of the Navigation block altogether


link to image

Ref: #25016

Proposed Solution

It would be great if there were a way to define the alignment support for blocks contextually - or be able to overide it when the block is used as an InnerBlock. Anything above that general idea is above my pay grade ;)

@gziolo gziolo added [Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P Needs Design Feedback Needs general design feedback. labels Nov 22, 2020
@talldan
Copy link
Contributor

talldan commented Nov 23, 2020

This sounds similar to what was introduced in #26380 with the layout prop:
https://github.com/WordPress/gutenberg/pull/26380/files#diff-1ec6503d5cd2292d6fd7edfbea747f6a9211a16c4c63bd6d894446603776beacR23-R26

Now when a button block is used within the buttons block the alignment option is not displayed, but if it's used outside buttons (I think this is currently only possibly by copy/pasting a button block in the code editor) it still does support alignment.

@jordesign
Copy link
Contributor Author

Thanks @talldan - does that mean a similar approach could be used with the Social Links block?

@talldan
Copy link
Contributor

talldan commented Nov 27, 2020

@jordesign Yep, I believe it could be defined on the navigation block to stop inner blocks having alignment.

@jordesign
Copy link
Contributor Author

Thanks for the direction @talldan - I was able to open a PR with the same approach as that used on the Buttons block.

@talldan talldan removed the Needs Design Feedback Needs general design feedback. label Jan 20, 2021
@talldan
Copy link
Contributor

talldan commented Jan 21, 2021

Fixed by #27365

@talldan talldan closed this as completed Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P
Projects
None yet
Development

No branches or pull requests

3 participants