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

Core Image block doesn't use align support property for Block Alignement #36434

Closed
fabiankaegy opened this issue Nov 12, 2021 · 1 comment
Closed
Labels
[Block] Image Affects the Image Block [Feature] Extensibility The ability to extend blocks or the editing experience

Comments

@fabiankaegy
Copy link
Member

Description

The default mechanism for adding alignment supports for blocks these days is specifying it in the block supports like so:

{
    "supports": {
        "align": ["wide", "full"]
    }
}

This comes with the nice benefit of being able to override the supported align properties for any block using the blocks.registerBlockType hook.

The Core Image Block does not use this newer API jet, but instead still uses the BlockAlignmentControl manually in its BlockEdit function. Which makes it pretty much impossible to filter/extend.

<BlockAlignmentControl
value={ align }
onChange={ updateAlignment }
/>

Proposed Solution:

remove the custom usage of the BlockAlignmentControl and replace it with the supports.align option in block.json

Step-by-step reproduction instructions

does not apply

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

@fabiankaegy fabiankaegy added [Feature] Extensibility The ability to extend blocks or the editing experience [Block] Image Affects the Image Block labels Nov 12, 2021
@fabiankaegy
Copy link
Member Author

This is a duplicate of #19103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Image Affects the Image Block [Feature] Extensibility The ability to extend blocks or the editing experience
Projects
None yet
Development

No branches or pull requests

1 participant