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

gallery block's alignwide class is not removable after saving #13170

Closed
m-e-h opened this issue Jan 2, 2019 · 3 comments
Closed

gallery block's alignwide class is not removable after saving #13170

m-e-h opened this issue Jan 2, 2019 · 3 comments
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Type] Bug An existing feature does not function as intended

Comments

@m-e-h
Copy link
Member

m-e-h commented Jan 2, 2019

Describe the bug
When "Wide width" is selected and saved for the gallery block, unselecting it doesn't remove the alignwide class in the editor or on the front-end.

To Reproduce
Steps to reproduce the behavior:

  1. Select "Wide width" for a gallery block and save the post.
  2. Refresh the edit post screen and remove the "Wide width" selection for the block. Save post.
  3. Check out your gallery block on the front-end and the editor. The alignwide class remains.

Expected behavior
alignwide shouldn't be present when Wide width isn't selected.

Screenshots
align-gallery

Related question: Why are we even adding these classes in the editor? https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/gallery/edit.js#L264

Shouldn't we be relying on [data-align="wide"] for these styles?

Desktop (please complete the following information):

  • OS: Ubuntu 18.04
  • Browser: chrome, firefox
  • Version: latest

Additional context

  • Tested and got the same result in WP 5.0.2 and the master branch of this repo.
@swissspidy swissspidy added Needs Testing Needs further testing to be confirmed. [Block] Gallery Affects the Gallery Block - used to display groups of images labels Jan 3, 2019
@jorgefilipecosta jorgefilipecosta self-assigned this Jan 4, 2019
@jorgefilipecosta jorgefilipecosta added the [Status] In Progress Tracking issues with work in progress label Jan 4, 2019
@m-e-h
Copy link
Member Author

m-e-h commented Jan 4, 2019

Thanks for checking it out @jorgefilipecosta !

I'm using TwentyNineteen v1.1 without any plugins active.

You're correct that during the block manipulation a class is being added in the class name inserter. The thing is that I'm not adding it. It's getting added when I update the post.

Here's a screencast of what I'm seeing https://drive.google.com/file/d/1WkwPtsA3c28OCz3n5WVRy-UmepivJRUA/view

@m-e-h
Copy link
Member Author

m-e-h commented Jan 4, 2019

Here's another gif showing how the classes add up as alignments are changed.

galalignclasses

You probably won't be able to repeat it unless you refresh screen after each update.

@jorgefilipecosta jorgefilipecosta removed their assignment Jun 5, 2019
@jorgefilipecosta jorgefilipecosta added [Type] Bug An existing feature does not function as intended and removed Needs Testing Needs further testing to be confirmed. [Status] In Progress Tracking issues with work in progress labels Jun 5, 2019
@talldan
Copy link
Contributor

talldan commented Feb 7, 2020

This one no longer seems to be an issue. I'll close, but @m-e-h, let me know if you're still experiencing this and I can reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants