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

Alignment available for all inner blocks #49580

Closed
andreaslindahl opened this issue Apr 4, 2023 · 7 comments
Closed

Alignment available for all inner blocks #49580

andreaslindahl opened this issue Apr 4, 2023 · 7 comments
Labels
[Status] Needs More Info Follow-up required in order to be actionable. [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. [Type] Help Request Help with setup, implementation, or "How do I?" questions.

Comments

@andreaslindahl
Copy link

andreaslindahl commented Apr 4, 2023

Description

I don't know if I'm only imagining this or not, but previously I could not set alignment on any inner blocks in any of my custom blocks, which is exactly what I wanted, since it risked interfering with the styling of the parent block.

Now, however, alignment can be set for all inner blocks in my custom blocks.

Has this functionality changed recently and is there any documentation on how to configure it?

Step-by-step reproduction instructions

  1. Create a block which allows inner blocks
  2. Add inner block, such as as heading
  3. Notice that the alignment option is available in the toolbar for the inner block
@kathrynwp
Copy link

Now, however, alignment can be set for all inner blocks in my custom blocks.

Has this functionality changed recently and is there any documentation on how to configure it?

The ability to choose an alignment on more blocks (such as a heading block, even when not nested) is an enhancement. :)

Could you be able to clarify what sort of configuration documentation you're looking for? Are you looking for guidance on how to remove alignment options on specific blocks, or all inner blocks, for example?

@kathrynwp kathrynwp added [Status] Needs More Info Follow-up required in order to be actionable. [Type] Help Request Help with setup, implementation, or "How do I?" questions. labels Apr 4, 2023
@andreaslindahl
Copy link
Author

Sorry, my description was perhaps a little too brief...

Since inner blocks previously could not have their alignment changed, but they can now, it appears that something has changed. So I'm wondering if it's possible to go back to the old functionality - with no alignment options for inner blocks - either for all inner blocks or just some inner blocks, depending on what's possible.

So, basically I'm wondering if its possible to disable alignment settings for some or all inner blocks and if there is some documentation that describes this change and how this functionality can be configured.

More options when it comes to block styling is of course a good thing, but in some cases I would really prefer to not have alignment options for inner blocks.

I've tried to Google this and have found some vague info about adding a layout parameter to the useInnerBlocksProps hook, but have found no documentation on how this actually works, so either the documentation has not been updated to reflect this change or the possible solution to this issue lies elsewhere.

@carolinan
Copy link
Contributor

I think it is related to this pull request #47477

@github-actions
Copy link

Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Apr 22, 2023
@tellthemachines tellthemachines removed the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label May 9, 2023
@tellthemachines
Copy link
Contributor

Nothing changed regarding which blocks receive alignment settings; that has to be configured on the block itself. E.g. Heading by default supports wide and full alignments.

What did change, as @carolinan pointed out, is that the container block layout configuration is now passed by default to its inner blocks. The consequence is that if your container block supports __experimentalLayout with a constrained type (or default type with the ability to set constrained by toggling "Inner blocks use content width" in the layout panel), then the inner blocks that support wide and full alignments (such as Heading) will now display those controls.

There's no way to fully disable alignment for all inner blocks of a container; even if the container doesn't support layout it's still possible for some blocks (such as Image) to align left or right. You could potentially leverage the register_block_type_args filter to fully disable alignments across the board, but that would mean blocks outside of the container wouldn't have alignments either.

Hope this helps!

@github-actions
Copy link

Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label May 25, 2023
@tellthemachines
Copy link
Contributor

I'm going to go ahead and close this as there is nothing actionable here. Please feel free to reopen if needed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs More Info Follow-up required in order to be actionable. [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. [Type] Help Request Help with setup, implementation, or "How do I?" questions.
Projects
None yet
Development

No branches or pull requests

4 participants