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

Copied wide-aligned blocks keep the alignment even in themes that don't support it #12333

Closed
webmandesign opened this issue Nov 26, 2018 · 5 comments
Assignees
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience Needs Decision Needs a decision to be actionable or relevant

Comments

@webmandesign
Copy link
Contributor

How to recreate

Copy the sample Gutenberg post content from https://wordpress.org/gutenberg/ (by switching to "Code Editor" view). And paste it into a test post on a website using a theme that does not support wide/full alignment of blocks.

Everything works as expected on a website front-end, however, when editing the post user keeps seeing the cover image full aligned. But there are no wide/full alignment buttons when editing the block.

When the block alignment is changed to left/right/center, the block is displayed correctly in admin too, matching the width of the other content elements/blocks.

The issue

This might bring a confusion to a user copying content from one source to another. User might want to recreate the full alignment, but failing doing so, and failing understanding how it actually works.

Expected behavior

When copying wide/full aligned block from a website that supports such alignment into a website that does not, the block should not be wide/full aligned when editing the post.

Screenshots

Copied full aligned image block into a site that does not support such alignment

Additional context

  • Gutenberg v4.5.1
@designsimply designsimply added the Needs Testing Needs further testing to be confirmed. label Nov 26, 2018
@designsimply
Copy link
Member

I tried the following steps and couldn't see copied alignfull images appear as full-width in the editor. I tested with the Twenty Fifteen theme and used Firefox on macOS for my test.

  1. Go to https://wordpress.org/gutenberg/
  2. Go to More > Code Editor and copy the code.
  3. Activate a theme that does not have support full or wide images (e.g. Twenty Fifteen).
  4. Paste the content from step 2 into a new post.

Result: the image at the top which is alignfull at https://wordpress.org/gutenberg/ did not have the alignfull designation after pasting.

screen shot 2018-11-27 at 11 04 01 am

Seen at https://tan-otter.jurassic.ninja/wp-admin/post.php?post=123&action=edit running WordPress 4.9.8 and Gutenberg 4.5.1 using Firefox 63.0.3 on macOS 10.13.6.

Do you see anything different in my testing steps compared to yours?

What OS and browser version did you use for testing?

What theme did you use for testing?

@designsimply designsimply added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Status] Needs More Info Follow-up required in order to be actionable. and removed [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Testing Needs further testing to be confirmed. labels Nov 27, 2018
@webmandesign
Copy link
Contributor Author

Oh, I see. You've basically pasted the copied content directly into Gutenberg's Visual Editor mode. I didn't realize this was actually possible.
Here is what I did instead (and that's where you get the image fullwidth):

  1. Go to https://wordpress.org/gutenberg/
  2. In "Show more tools & options" (3 vertical dots in upper right corner) choose Code Editor
  3. Copy the post content code
  4. Create a new post on a test website using Gutenberg, set post title
  5. In "Show more tools & options" switch over to Code Editor
  6. Paste the copied content code into the "Start writing with text or HTML" field
  7. In "Show more tools & options" switch back to Visual Editor

For information, I've used super-plain testing theme (download zip if further tests needed).

@designsimply
Copy link
Member

@manake also pointed out in #12948 that disabling align-wide doesn't refresh the block and I think we can consolidate that report here as well:

Steps to reproduce the behavior:

  1. In functions.php add add_theme_support( 'align-wide' );
  2. Create a new post with a full wide image and save it.
  3. In functions.php remove add_theme_support( 'align-wide' );
  4. Open the post editing screen and see that the image is still full wide.

@designsimply designsimply added [Feature] Extensibility The ability to extend blocks or the editing experience Needs Decision Needs a decision to be actionable or relevant and removed [Status] Needs More Info Follow-up required in order to be actionable. labels Dec 17, 2018
@designsimply
Copy link
Member

I added the Needs Decision label to ask specifically what should happen when align-wide content is opened in a theme that does not have align-wide support.

@manake
Copy link

manake commented Dec 17, 2018

Can I remove data-align="full" by myself as a workaround before there is an official solution?

How would I do that?

Maybe there exists some wp.refreshGutenberg() that would do it that I could call on $(document).ready()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience Needs Decision Needs a decision to be actionable or relevant
Projects
None yet
Development

No branches or pull requests

4 participants