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

Mobile issues for Vesta design in editor #47293

Closed
razvanpapadopol opened this issue Nov 10, 2020 · 9 comments
Closed

Mobile issues for Vesta design in editor #47293

razvanpapadopol opened this issue Nov 10, 2020 · 9 comments
Assignees
Labels
Mobile Web [Pri] Normal Schedule for the next available opportuinity. [Status] Stale [Type] Bug When a feature is broken and / or not performing as intended

Comments

@razvanpapadopol
Copy link

razvanpapadopol commented Nov 10, 2020

Steps to reproduce

  1. Starting at URL: https://wordpress.com/new
  2. Select Vesta design: https://cloudup.com/cvrIpTeKMry
  3. Complete the flow to create a new site.
  4. Open the editor on mobile.

What I expected

  • Design to be displayed as in preview

Screenshot 2020-11-10 at 22 50 38

What happened instead

  • Content seems to be cropped

Screenshot 2020-11-06 at 17 56 47

OS / Browser / Device

  • Android / Google Chrome / Samsung Galaxy s10
  • MacOS / Google Chrome ( window < 560px wide)
@razvanpapadopol razvanpapadopol added [Type] Bug When a feature is broken and / or not performing as intended Mobile Web labels Nov 10, 2020
@jeyip
Copy link
Contributor

jeyip commented Nov 10, 2020

@razvanpapadopol I'm still having a bit of trouble reproducing the issue. I followed these steps:

  1. Starting at URL: https://wordpress.com/new
  2. Select Vesta design: https://cloudup.com/cvrIpTeKMry
  3. Complete the flow to create a new site.
  4. Open the editor on mobile.

I created this website hello309119077.wordpress.com. I checked mobile viewport widths in the chrome browser. I also opened the site on my iphone 8. The mobile layouts in both instances appear to behave as expected with a single column layout. 🤔

@razvanpapadopol
Copy link
Author

I was able to reproduce now in wp-admin of the site you've created so we know this is not user-related. Everything looks fine until the viewport is less than 560px wide.

I've also updated the issue with OS / Browser / Device section.

@yansern
Copy link
Contributor

yansern commented Nov 11, 2020

Most likely something to do with [data-align=full], margin-left: -30px and also suspect if .wp-block-jetpack-layout-gutter__nowrap is somehow related.

image

@jeyip jeyip added the [Pri] Normal Schedule for the next available opportuinity. label Nov 11, 2020
@alshakero alshakero self-assigned this Dec 4, 2020
@alshakero
Copy link
Member

I investigated this and it seems that some themes use the experimental Layout Grid. Layout grid accepts a prop called "displayType: "Desktop" | "Mobile" | Tablet". It uses this prop to determine the layout.

This means that the screen width isn't taken into account, rather, the display type you select when you click "Preview" button in the top right corner of the editor in Desktop mode.

Since we're hiding the display type picker in mobile anyways, I think we should change the "displayType" value to "Mobile" in mobile devices. Currently, display type is fetched from the core/edit-post store and isn't tied in any way to the screen size.

@alshakero alshakero removed their assignment Dec 7, 2020
@roo2 roo2 self-assigned this Dec 9, 2020
@roo2
Copy link
Contributor

roo2 commented Dec 10, 2020

This issue in the Layout Grid seems to be related. Automattic/block-experiments#152

It looks like the setting that effects it is the __experimentalGetPreviewDeviceType used in edit.js this value does always seem to be set to desktop. And in fact edit.js is not used in the site preview, so there is no point in using this variable in edit.js.

I did notice that even when I manualy changed __experimentalGetPreviewDeviceType to Mobile, the page content of this vesta template still overflowed.

Screen Shot 2020-12-10 at 4 35 02 PM

So there seem to be two issues at play here.

@roo2
Copy link
Contributor

roo2 commented Dec 11, 2020

Aside from the columns not rendering in mobile mode, the reason that the content is pushed off the screen is actually related to the has-background class. the has-background triggers some style rules to take effect which push the content out of the normal padding an right to the edge of the screen on desktop. However, on mobile the padding is smaller, so the content is pushed right out of the screen.

I'll raise this issue upstream in gutenberg.

But for the Vesta design, why does it need a background color? the background color is set to white, which is the default background color anyway...

I've made a diff to remove background color from Vesta's homepage template which fixes the theme's editor experience on Mobile. D54150-code

@roo2
Copy link
Contributor

roo2 commented Dec 14, 2020

I created a PR to fix this in a8c themes Automattic/themes#2909

@github-actions
Copy link

This issue is stale because it has been 180 days with no activity. You can keep the issue open by adding a comment. If you do, please provide additional context and explain why you’d like it to remain open. You can also close the issue yourself — if you do, please add a brief explanation and apply one of relevant issue close labels.

@roo2
Copy link
Contributor

roo2 commented Jun 13, 2021

@roo2 roo2 closed this as completed Jun 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mobile Web [Pri] Normal Schedule for the next available opportuinity. [Status] Stale [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

No branches or pull requests

5 participants