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

[AMP Stories] Disable Alignment for Image Block #2115

Closed
westonruter opened this issue Apr 11, 2019 · 10 comments
Closed

[AMP Stories] Disable Alignment for Image Block #2115

westonruter opened this issue Apr 11, 2019 · 10 comments
Assignees
Milestone

Comments

@westonruter
Copy link
Member

I tried changing the alignment options for an image in AMP Stories:

image

But they had no effect on the image in the frontend. This is entirely expected, since the image is not inline with other blocks, being that it is absolutely positioned. So the alignment options should just be eliminated. This goes for other blocks as well.

@swissspidy
Copy link
Collaborator

Unfortunately the core/image block does not use the align option in supports, so the block alignment toolbar is pretty much hardcoded.

Otherwise we could use the registerBlockType filter to disable alignment for the block.

Related upstream issue: WordPress/gutenberg#13780

@swissspidy swissspidy changed the title Image alignment controls have no effect in stories and should be removed [AMP Stories] Disable Alignment for Image Block Apr 12, 2019
@westonruter
Copy link
Member Author

This is particularly confusing when a theme supports wide images, as there are even more buttons:

image

@csossi
Copy link

csossi commented May 8, 2019

Still seeing controls for images:
image

@csossi csossi reopened this May 8, 2019
@csossi csossi assigned miina and unassigned csossi May 8, 2019
@miina miina removed their assignment May 8, 2019
@swissspidy
Copy link
Collaborator

Looks like the alignment options are back now because of #2179.

But that screenshot doesn't show the current state of the stories editor either way...

@miina
Copy link
Contributor

miina commented May 8, 2019

@swissspidy I think that the test environment wasn't updated, it should be now, however, this issue still needs addressing again.

@swissspidy
Copy link
Collaborator

Hmm there aren't really any good CSS selectors for the top toolbar to know which block is currently selected...

@miina
Copy link
Contributor

miina commented May 13, 2019

Maybe one option could be adding an additional class name ourselves either to the toolbar or to a parent element if an image block is selected?

@swissspidy
Copy link
Collaborator

Yeah I was thinking the same, as this would be needed for #2283 as well.

@swissspidy
Copy link
Collaborator

@csossi Can you test this again? Thanks!

@csossi
Copy link

csossi commented May 15, 2019

Verified in QA:
Alignment disabled

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants