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

InnerBlocks doesn't show align wide/full controls when inside a custom block #64078

Open
2 tasks done
simom opened this issue Jul 30, 2024 · 2 comments
Open
2 tasks done
Labels
[Type] Bug An existing feature does not function as intended

Comments

@simom
Copy link

simom commented Jul 30, 2024

Description

I have a custom block that supports InnerBlocks, and if I remove the 'layout' support from the block.json, the InnerBlocks (which natively support wide/full alignment, like Group or Columns) no longer show the alignment toolbar control.

I have searched through tickets and tried to manually force the layout to be constrained to the innerBlockProps as suggested by @tellthemachines in this ticket #43731 (comment), but without success.

Am I doing something wrong?

Step-by-step reproduction instructions

  • define a custom block with innerBlocks support
  • make sure that there isn't the "layout" support in the block.json
  • pass the layout constrained support to the innerBlockProps of the custom block
  • add a group block inside the custom block

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress 6.6.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
@simom simom added the [Type] Bug An existing feature does not function as intended label Jul 30, 2024
@SH4LIN
Copy link
Contributor

SH4LIN commented Aug 2, 2024

I think this is intentional. If the parent block (in this case, your custom block) does not support wide and full alignment, then logically, its inner blocks shouldn't support it either.

Try adding align: ['wide', 'full'] to your custom block.

@simom
Copy link
Author

simom commented Aug 2, 2024

Hi @SH4LIN, thanks for the reply. The parent block already has alignment support. I believe this should be possible since there shouldn't be a relation between the "layout" support and the alignment in theory (I know that there is a guard in the component). Following the example from the referenced ticket, it should be possible to enable the constrained mode even if the support is not present, or at least this is how I think it should work.

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

No branches or pull requests

2 participants