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

WPCOM Block Editor: Fix incorrect editor position on mobile #38388

Merged
merged 1 commit into from
Dec 17, 2019

Conversation

Copons
Copy link
Contributor

@Copons Copons commented Dec 12, 2019

Changes proposed in this Pull Request

WordPress/gutenberg#18686 changed how the editor is positioned on mobile.
In Core the admin bar is always visible, even in fullscreen mode.

In WPCOM, instead, the admin bar is never visible, so we don't need the top offset for it.

This PR sets top: 0 to the elements affected by the changes in Gutenberg 7.1.0 (at least those that I've noticed).

I've also removed a couple of rules that aren't applicable anymore, as .edit-post-layout__content has been recently removed.

Before After
Screenshot 2019-12-12 at 18 36 04 Screenshot 2019-12-12 at 18 36 14

Testing instructions

Pre-requisites:

  • Apply D36681-code (the twin diff of this PR).
  • Sandbox widgets.wp.com.
  • Pre-sandbox a new site.

Test:

  • In Calypso, edit a page in the block editor.
  • Resize the browser down to a mobile width.
  • Make sure the editor's top bar and notifications are stuck to the top.

@Copons Copons added [Type] Bug [Feature] Post/Page Editor The editor for editing posts and pages. [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Team] Cylon labels Dec 12, 2019
@Copons Copons requested review from kwight and a team December 12, 2019 18:45
@Copons Copons requested review from a team as code owners December 12, 2019 18:45
@Copons Copons self-assigned this Dec 12, 2019
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

Copy link
Member

@mmtr mmtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I verified this fixes the layout on Simple, Jetpack and Atomic sites. I also checked this doesn't break the layout when a Jetpack or Atomic site runs an older version of Gutenberg.

I noted that the placeholder is still misaligned, but totally unrelated to this PR:

Screenshot 2019-12-13 at 11 57 21

@Copons Copons force-pushed the fix/gutenframe-mobile-top-offset branch from 4d45a21 to 511e4ea Compare December 16, 2019 12:04
@Copons Copons merged commit dd230e0 into master Dec 17, 2019
@Copons Copons deleted the fix/gutenframe-mobile-top-offset branch December 17, 2019 12:52
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Post/Page Editor The editor for editing posts and pages. [Team] Cylon [Type] Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants