My Jetpack: fix Overview tab scrolling under fixed wpbody-content#48578
Conversation
`.my-jetpack-screen { overflow-x: hidden }` was applied to the same div as
`.jp-admin-page` (via `<AdminPage className={ ... } />`). Browsers promote
the unset `overflow-y: visible` to `auto` when the other axis is
`hidden`/`scroll`/`clip`, which silently turned `.jp-admin-page` into a
scroll container. Once the inner middle reached its scroll end, wheel
events propagated to `.jp-admin-page` and shifted the entire page (header
+ middle + footer) up under the fixed `#wpbody-content`, exposing blank
space below the footer.
Drop the rule (it pre-dated the recent 100vw breakout cleanup and is
no longer needed — the mixin's inner middle already handles horizontal
overflow with `overflow: auto`, and `#wpbody-content` is the ultimate
clip boundary).
Defensively, add `overflow: visible` to `.jp-admin-page` in the layout
mixin so any future consumer that drops a className with
`overflow-x: hidden` on the AdminPage root won't reintroduce the bug
(mixin specificity beats consumer single-class selectors).
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
…8578) `.my-jetpack-screen { overflow-x: hidden }` was applied to the same div as `.jp-admin-page` (via `<AdminPage className={ ... } />`). Browsers promote the unset `overflow-y: visible` to `auto` when the other axis is `hidden`/`scroll`/`clip`, which silently turned `.jp-admin-page` into a scroll container. Once the inner middle reached its scroll end, wheel events propagated to `.jp-admin-page` and shifted the entire page (header + middle + footer) up under the fixed `#wpbody-content`, exposing blank space below the footer. Drop the rule (it pre-dated the recent 100vw breakout cleanup and is no longer needed — the mixin's inner middle already handles horizontal overflow with `overflow: auto`, and `#wpbody-content` is the ultimate clip boundary). Defensively, add `overflow: visible` to `.jp-admin-page` in the layout mixin so any future consumer that drops a className with `overflow-x: hidden` on the AdminPage root won't reintroduce the bug (mixin specificity beats consumer single-class selectors).
Fixes the scroll-past-the-end regression on the My Jetpack Overview tab introduced (visibly) by the recent layout-mixin adoption (#48503), and adds a defensive guard in the layout mixin so the same trap can't bite future consumers.
Proposed changes
overflow-x: hiddenon the<AdminPage>root..my-jetpack-screen { overflow-x: hidden }was applied to the same div as.jp-admin-page(via<AdminPage className={ … }>). Browsers promote the unsetoverflow-y: visibletoautowhen the other axis ishidden/scroll/clip, so.jp-admin-pagewas silently turning into a scroll container. Once the inner middle reached its scroll end, wheel events propagated to.jp-admin-pageand shifted the whole page (header + middle + footer) up under the fixed#wpbody-content, exposing blank space below the footer. The rule pre-dated the recent100vwbreakout cleanup and was no longer load-bearing — the mixin's inner middle already handles horizontal overflow withoverflow: auto, and#wpbody-contentis the ultimate clip boundary.@automattic/jetpack-base-styles/admin-page-layoutmixin: addoverflow: visibleon.jp-admin-page. Defensive, so any future consumer that drops a className withoverflow-x: hiddenon the AdminPage root won't reintroduce the same bug. Mixin specificity (body.jetpack_page_<slug> .jp-admin-page) beats consumer single-class selectors, so the override wins.Related product discussion/links
.jetpack-admin-full-screenopt-out fix).visualprop for Jetpack logo #48410 (admin-ui 2.0): that PR renames.admin-ui-page*→.jp-admin-page__page*but does not touch.jp-admin-pageitself, so the rule added here keeps applying after that update lands.Does this pull request change what data or activity we track or use?
No. CSS/layout-only change.
Testing instructions
Repro the bug on
trunk:admin.php?page=my-jetpack#/overview.With this PR applied:
Smoke-test on the other migrated mixin pages — the layout should be unchanged.
.jp-admin-pageshould beoverflow: visible(not a scroll container) on each:?page=my-jetpack) — Overview, Products, Help tabs?page=jetpack-protect)?page=jetpack-social)?page=jetpack-videopress)?page=jetpack-backup)?page=jetpack-newsletter)?page=jetpack-search)?page=jetpack-boost)?page=jetpack-activity-log)A quick console probe at each:
getComputedStyle(document.querySelector('.jp-admin-page')).overflowshould reportvisible, and only the inner.container--SqdhU.fluid--OZC_9(or in PR #48410's structure, the.jp-admin-page__page > :not(header):not(.jetpack-footer)middle) should reportauto.